diff --git a/LrcParser.Tests/Parser/Lrc/LrcParserTest.cs b/LrcParser.Tests/Parser/Lrc/LrcParserTest.cs index d1ed788..b87793c 100644 --- a/LrcParser.Tests/Parser/Lrc/LrcParserTest.cs +++ b/LrcParser.Tests/Parser/Lrc/LrcParserTest.cs @@ -14,7 +14,7 @@ public void TestDecode() { var lrcText = new[] { - "[00:17.00] <00:00.00>帰<00:01.00>り<00:02.00>道<00:03.00>は<00:04.00>", + "[00:17.00] <00:17.00>帰<00:18.00>り<00:19.00>道<00:20.00>は<00:21.00>", }; var song = new Song @@ -65,7 +65,7 @@ public void TestEncode() var lrcText = new[] { - "[00:17.00] <00:00.00>帰<00:01.00>り<00:02.00>道<00:03.00>は<00:04.00>", + "[00:17.00] <00:17.00>帰<00:18.00>り<00:19.00>道<00:20.00>は<00:21.00>", }; checkEncode(song, lrcText); diff --git a/LrcParser/Parser/Lrc/LrcParser.cs b/LrcParser/Parser/Lrc/LrcParser.cs index c4aa108..f823bae 100644 --- a/LrcParser/Parser/Lrc/LrcParser.cs +++ b/LrcParser/Parser/Lrc/LrcParser.cs @@ -37,13 +37,13 @@ static IEnumerable convertLyric(LrcLyric lrcLyric) { Text = lrcLyric.Text, StartTime = startTime, - TimeTags = getTimeTags(lrcLyric.TimeTags, startTime), + TimeTags = getTimeTags(lrcLyric.TimeTags), }; } } - static SortedDictionary getTimeTags(SortedDictionary timeTags, int offsetTime) - => new(timeTags.ToDictionary(k => k.Key, v => v.Value + offsetTime as int?)); + static SortedDictionary getTimeTags(SortedDictionary timeTags) + => new(timeTags.ToDictionary(k => k.Key, v => v.Value as int?)); } protected override IEnumerable PreProcess(Song song) @@ -58,7 +58,7 @@ protected override IEnumerable PreProcess(Song song) { Text = lyric.Text, StartTimes = [lyric.StartTime], - TimeTags = getTimeTags(lyric.TimeTags, -lyric.StartTime), + TimeTags = getTimeTags(lyric.TimeTags), }; } @@ -72,7 +72,7 @@ protected override IEnumerable PreProcess(Song song) yield break; - static SortedDictionary getTimeTags(SortedDictionary timeTags, int offsetTime = 0) - => new(timeTags.Where(x => x.Value.HasValue).ToDictionary(k => k.Key, v => v.Value!.Value + offsetTime)); + static SortedDictionary getTimeTags(SortedDictionary timeTags) + => new(timeTags.Where(x => x.Value.HasValue).ToDictionary(k => k.Key, v => v.Value!.Value)); } } diff --git a/LrcParser/Parser/Lrc/Metadata/LrcLyric.cs b/LrcParser/Parser/Lrc/Metadata/LrcLyric.cs index 911d27a..23008c1 100644 --- a/LrcParser/Parser/Lrc/Metadata/LrcLyric.cs +++ b/LrcParser/Parser/Lrc/Metadata/LrcLyric.cs @@ -24,7 +24,7 @@ public LrcLyric() /// /// Time tags. - /// It's the relative time from the start time. + /// It's the absolute time. /// public SortedDictionary TimeTags { get; set; } = new();