From be46090052a302caafea0cac7d24bc0b77116e22 Mon Sep 17 00:00:00 2001 From: univrsal Date: Sat, 18 May 2024 12:31:32 +0200 Subject: [PATCH] Lyrics: Improve matching --- data/lyrics.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/data/lyrics.html b/data/lyrics.html index 15b16b4..ca20e5d 100644 --- a/data/lyrics.html +++ b/data/lyrics.html @@ -85,7 +85,14 @@ .then(data => { try { if (data.length > 0) { - current_lyrics = parseLyrics(data[0].syncedLyrics); + let index = 0; + for (let i = 0; i < data.length; i++) { + if (data[i].trackName.toLowerCase() === title.toLowerCase()) { + index = i; + break; + } + } + current_lyrics = parseLyrics(data[index].syncedLyrics); lyrics.innerHTML = ""; for (let i = 0; i < current_lyrics.length; i++) {