From 97d27dc6833f4e3b42c29ae385b3ad321a338f92 Mon Sep 17 00:00:00 2001 From: NeoCoderMatrix86 <40752681+NeoCoderMatrix86@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:04:14 +0200 Subject: [PATCH] Update CuesheetImportfile.cs --- .../Model/IO/Import/CuesheetImportfile.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/AudioCuesheetEditor/Model/IO/Import/CuesheetImportfile.cs b/AudioCuesheetEditor/Model/IO/Import/CuesheetImportfile.cs index f9868c04..a6ee50fb 100644 --- a/AudioCuesheetEditor/Model/IO/Import/CuesheetImportfile.cs +++ b/AudioCuesheetEditor/Model/IO/Import/CuesheetImportfile.cs @@ -65,8 +65,8 @@ public CuesheetImportfile(MemoryStream fileContent, ApplicationOptions applicati var regexCDTextfile = new Regex("^" + CuesheetConstants.CuesheetCDTextfile + " \"(?'" + cuesheetCDTextfileGroupName + "'.{0,})\""); var regexCatalogueNumber = new Regex("^" + CuesheetConstants.CuesheetCatalogueNumber + " (?'" + cuesheetCatalogueNumberGroupName + "'.{0,})"); Track? track = null; - List lines = new(); - List? recognizedLines = new(); + List lines = []; + List? recognizedLines = []; while (reader.EndOfStream == false) { var line = reader.ReadLine(); @@ -214,9 +214,9 @@ public CuesheetImportfile(MemoryStream fileContent, ApplicationOptions applicati var matchGroup = match.Groups.GetValueOrDefault(trackPreGapGroupName); if (matchGroup != null) { - var minutes = int.Parse(matchGroup.Value.Substring(0, matchGroup.Value.IndexOf(":"))); - var seconds = int.Parse(matchGroup.Value.Substring(matchGroup.Value.IndexOf(":") + 1, 2)); - var frames = int.Parse(matchGroup.Value.Substring(matchGroup.Value.LastIndexOf(":") + 1)); + var minutes = int.Parse(matchGroup.Value.Substring(0, matchGroup.Value.IndexOf(':'))); + var seconds = int.Parse(matchGroup.Value.Substring(matchGroup.Value.IndexOf(':') + 1, 2)); + var frames = int.Parse(matchGroup.Value.Substring(matchGroup.Value.LastIndexOf(':') + 1)); if (track != null) { track.PreGap = new TimeSpan(0, 0, minutes, seconds, Convert.ToInt32((frames / 75.0) * 1000)); @@ -238,9 +238,9 @@ public CuesheetImportfile(MemoryStream fileContent, ApplicationOptions applicati var matchGroup = match.Groups.GetValueOrDefault(trackIndex01GroupName); if (matchGroup != null) { - var minutes = int.Parse(matchGroup.Value.Substring(0, matchGroup.Value.IndexOf(":"))); - var seconds = int.Parse(matchGroup.Value.Substring(matchGroup.Value.IndexOf(":") + 1, 2)); - var frames = int.Parse(matchGroup.Value.Substring(matchGroup.Value.LastIndexOf(":") + 1)); + var minutes = int.Parse(matchGroup.Value.Substring(0, matchGroup.Value.IndexOf(':'))); + var seconds = int.Parse(matchGroup.Value.Substring(matchGroup.Value.IndexOf(':') + 1, 2)); + var frames = int.Parse(matchGroup.Value.Substring(matchGroup.Value.LastIndexOf(':') + 1)); if (track != null) { track.Begin = new TimeSpan(0, 0, minutes, seconds, Convert.ToInt32((frames / 75.0) * 1000)); @@ -270,9 +270,9 @@ public CuesheetImportfile(MemoryStream fileContent, ApplicationOptions applicati var matchGroup = match.Groups.GetValueOrDefault(trackPostGapGroupName); if (matchGroup != null) { - var minutes = int.Parse(matchGroup.Value.Substring(0, matchGroup.Value.IndexOf(":"))); - var seconds = int.Parse(matchGroup.Value.Substring(matchGroup.Value.IndexOf(":") + 1, 2)); - var frames = int.Parse(matchGroup.Value.Substring(matchGroup.Value.LastIndexOf(":") + 1)); + var minutes = int.Parse(matchGroup.Value.Substring(0, matchGroup.Value.IndexOf(':'))); + var seconds = int.Parse(matchGroup.Value.Substring(matchGroup.Value.IndexOf(':') + 1, 2)); + var frames = int.Parse(matchGroup.Value.Substring(matchGroup.Value.LastIndexOf(':') + 1)); if (track != null) { track.PostGap = new TimeSpan(0, 0, minutes, seconds, Convert.ToInt32((frames / 75.0) * 1000));