Skip to content

Commit

Permalink
Lyrics: Improve matching
Browse files Browse the repository at this point in the history
  • Loading branch information
univrsal committed May 18, 2024
1 parent 6058f70 commit be46090
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion data/lyrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {

Expand Down

0 comments on commit be46090

Please sign in to comment.