diff --git a/LrcParser.Tests/Parser/Lrc/Utils/LrcTimedTextUtilsTest.cs b/LrcParser.Tests/Parser/Lrc/Utils/LrcTimedTextUtilsTest.cs index 6111bc3..8b26b74 100644 --- a/LrcParser.Tests/Parser/Lrc/Utils/LrcTimedTextUtilsTest.cs +++ b/LrcParser.Tests/Parser/Lrc/Utils/LrcTimedTextUtilsTest.cs @@ -15,7 +15,7 @@ public class LrcTimedTextUtilsTest [TestCase("[00:17:97]帰[00:18:37]り[00:18:55]道[00:18:94]は[00:19:22] ", "帰り道は ", new[] { "[0,start]:17970", "[1,start]:18370", "[2,start]:18550", "[3,start]:18940", "[3,end]:19220" })] [TestCase("帰[00:18:37]り[00:18:55]道[00:18:94]は[00:19:22]", "帰り道は", new[] { "[1,start]:18370", "[2,start]:18550", "[3,start]:18940", "[3,end]:19220" })] [TestCase("[00:17:97]帰[00:18:37]り[00:18:55]道[00:18:94]は", "帰り道は", new[] { "[0,start]:17970", "[1,start]:18370", "[2,start]:18550", "[3,start]:18940" })] - [TestCase("[00:51.00][01:29.99][01:48.29][02:31.00][02:41.99]You gotta fight !", "You gotta fight !", new string[] { "[0,start]:51000" })] // decode with invalid format. + [TestCase("[00:51.00][01:29.99][01:48.29][02:31.00][02:41.99]You gotta fight !", "You gotta fight !", new[] { "[0,start]:51000" })] // decode with invalid format. [TestCase("帰り道は", "帰り道は", new string[] { })] [TestCase("", "", new string[] { })] [TestCase(null, "", new string[] { })] diff --git a/LrcParser/Model/TextIndex.cs b/LrcParser/Model/TextIndex.cs index d1dfb8a..58bd2d5 100644 --- a/LrcParser/Model/TextIndex.cs +++ b/LrcParser/Model/TextIndex.cs @@ -37,7 +37,7 @@ public bool Equals(TextIndex other) return Index == other.Index && State == other.State; } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is TextIndex textIndex) return Equals(textIndex); diff --git a/LrcParser/Parser/Lrc/Lines/LrcRubyParser.cs b/LrcParser/Parser/Lrc/Lines/LrcRubyParser.cs index 8308bcc..53ef629 100644 --- a/LrcParser/Parser/Lrc/Lines/LrcRubyParser.cs +++ b/LrcParser/Parser/Lrc/Lines/LrcRubyParser.cs @@ -45,7 +45,7 @@ public override string Encode(LrcRuby component, int index) var input = $"@Ruby{index + 1}={parent},{ruby},{startTime},{endTime}"; - const string remove_last_comma_pattern = @"([,]*)$"; + const string remove_last_comma_pattern = "([,]*)$"; return Regex.Replace(input, remove_last_comma_pattern, ""); } } diff --git a/LrcParser/Parser/Lrc/Utils/TimeTagUtils.cs b/LrcParser/Parser/Lrc/Utils/TimeTagUtils.cs index 7944474..e9d801b 100644 --- a/LrcParser/Parser/Lrc/Utils/TimeTagUtils.cs +++ b/LrcParser/Parser/Lrc/Utils/TimeTagUtils.cs @@ -36,6 +36,7 @@ internal static int TimeTagToMillionSecond(string timeTag) { if (timeTag.Length < 10 || timeTag[0] != '[' || !char.IsDigit(timeTag[1])) return -1; + int minute = int.Parse(timeTag.Substring(1, 2)); int second = int.Parse(timeTag.Substring(4, 2)); int millionSecond = int.Parse(timeTag.Substring(7, 2));