Skip to content

Commit 5dbc21b

Browse files
committed
fix: am lyrics parse
1 parent a697a18 commit 5dbc21b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

BetterLyrics.WinUI3/Parsers/LyricsContentParser/LyricsContentParser.Ttml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private void ParseTtmlSegment(
128128
EndMs = containerEndMs,
129129
PrimaryText = fullOriginalText,
130130
PrimarySyllables = syllables,
131-
IsPrimaryHasRealSyllableInfo = true,
131+
IsPrimaryHasRealSyllableInfo = syllables.Count > 0,
132132
});
133133

134134
var transSpan = container.Elements()

BetterLyrics.WinUI3/Services/LyricsSearchService/LyricsSearchService.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,13 @@ private async Task<LyricsCacheItem> SearchAppleMusicAsync(SongInfo songInfo)
689689

690690
_logger.LogInformation("SearchAppleMusicAsync");
691691

692+
//lyricsSearchResult.Title = songInfo.Title;
693+
//lyricsSearchResult.Artist = songInfo.Artist;
694+
//lyricsSearchResult.Album = songInfo.Album;
695+
//lyricsSearchResult.Duration = songInfo.Duration;
696+
//lyricsSearchResult.Raw = "<tt xmlns=\"http://www.w3.org/ns/ttml\" xmlns:itunes=\"http://music.apple.com/lyric-ttml-internal\" xmlns:ttm=\"http://www.w3.org/ns/ttml#metadata\" itunes:timing=\"Line\" xml:lang=\"ja\"><head><metadata><ttm:agent type=\"person\" xml:id=\"v1\"><ttm:name type=\"full\">AZU</ttm:name></ttm:agent><iTunesMetadata xmlns=\"http://music.apple.com/lyric-ttml-internal\" leadingSilence=\"0.000\"><translations/><songwriters><songwriter>Naho</songwriter><songwriter>h-wonder</songwriter></songwriters></iTunesMetadata></metadata></head><body dur=\"04:06.293\"><div begin=\"00:00\" end=\"00:38.693\" itunes:songPart=\"Verse\"><p begin=\"00:00\" end=\"00:25.275\" itunes:key=\"L1\" ttm:agent=\"v1\">昨日までの痛みは和らいで 君の夢包まれる</p><p begin=\"00:25.275\" end=\"00:33.24\" itunes:key=\"L2\" ttm:agent=\"v1\">もう一度あの日のように 君を見つめたい</p><p begin=\"00:33.24\" end=\"00:38.693\" itunes:key=\"L3\" ttm:agent=\"v1\">今ならば I can say my truth</p></div><div begin=\"00:38.693\" end=\"00:54.427\" itunes:songPart=\"Verse\"><p begin=\"00:38.693\" end=\"00:45.119\" itunes:key=\"L4\" ttm:agent=\"v1\">Dream of your love, I'm thinking of you</p><p begin=\"00:45.278\" end=\"00:54.427\" itunes:key=\"L5\" ttm:agent=\"v1\">時よ take back あの日の二人に</p></div><div begin=\"00:54.427\" end=\"01:21.411\" itunes:songPart=\"Verse\"><p begin=\"00:54.427\" end=\"01:04.596\" itunes:key=\"L6\" ttm:agent=\"v1\">Every time I 最後の恋 きっと君以上に誰も</p><p begin=\"01:04.596\" end=\"01:13.995\" itunes:key=\"L7\" ttm:agent=\"v1\">愛せはしない sweet baby もっと早く強く</p><p begin=\"01:13.995\" end=\"01:21.411\" itunes:key=\"L8\" ttm:agent=\"v1\">この気持ちを baby 叶えてあげたかった</p></div><div begin=\"01:35.877\" end=\"02:01.499\" itunes:songPart=\"Verse\"><p begin=\"01:35.877\" end=\"01:48.581\" itunes:key=\"L9\" ttm:agent=\"v1\">思い出は遠ざかるほどまるで 映画のように色づく</p><p begin=\"01:48.581\" end=\"01:56.18\" itunes:key=\"L10\" ttm:agent=\"v1\">お互いに子供すぎたって 今ならわかる</p><p begin=\"01:56.18\" end=\"02:01.499\" itunes:key=\"L11\" ttm:agent=\"v1\">優しささえ棘を刺す</p></div><div begin=\"02:01.499\" end=\"02:17.614\" itunes:songPart=\"Verse\"><p begin=\"02:01.499\" end=\"02:08.352\" itunes:key=\"L12\" ttm:agent=\"v1\">Dream of your love, I'm feeling for you</p><p begin=\"02:08.352\" end=\"02:17.614\" itunes:key=\"L13\" ttm:agent=\"v1\">心 今も置き去りのままで</p></div><div begin=\"02:17.614\" end=\"02:45.979\" itunes:songPart=\"Verse\"><p begin=\"02:17.614\" end=\"02:28.674\" itunes:key=\"L14\" ttm:agent=\"v1\">Every time I 最後の恋 夢で会える君はいつも</p><p begin=\"02:28.674\" end=\"02:37.191\" itunes:key=\"L15\" ttm:agent=\"v1\">勇気をくれる sweet honey 振り向くよりちゃんと</p><p begin=\"02:37.191\" end=\"02:45.979\" itunes:key=\"L16\" ttm:agent=\"v1\">前を向いて baby 新しい自分になりたい</p></div><div begin=\"02:46.44\" end=\"03:09.476\" itunes:songPart=\"Verse\"><p begin=\"02:46.44\" end=\"02:51.331\" itunes:key=\"L17\" ttm:agent=\"v1\">明けてゆく 今日の空に</p><p begin=\"02:51.331\" end=\"03:03.814\" itunes:key=\"L18\" ttm:agent=\"v1\">君の夢と say goodbye 小さな光見つめている</p><p begin=\"03:03.814\" end=\"03:09.476\" itunes:key=\"L19\" ttm:agent=\"v1\">My heart is still brightly</p></div><div begin=\"03:09.476\" end=\"03:53.997\" itunes:songPart=\"Verse\"><p begin=\"03:09.476\" end=\"03:18.939\" itunes:key=\"L20\" ttm:agent=\"v1\">Every time I 最後の恋 きっと君以上に誰も</p><p begin=\"03:18.939\" end=\"03:28.685\" itunes:key=\"L21\" ttm:agent=\"v1\">愛せはしない sweet baby もっと早く強く</p><p begin=\"03:28.685\" end=\"03:36.262\" itunes:key=\"L22\" ttm:agent=\"v1\">この気持ちをbaby 叶えてあげたかった</p><p begin=\"03:36.262\" end=\"03:53.997\" itunes:key=\"L23\" ttm:agent=\"v1\">Sweet baby</p></div></body></tt>";
697+
//lyricsSearchResult.MatchPercentage = 100;
698+
692699
if (await _appleMusic.InitAsync())
693700
{
694701
lyricsSearchResult = await _appleMusic.SearchSongInfoAsync(songInfo);

0 commit comments

Comments
 (0)