StemDeck looks lyrics up on LRCLIB in two separate places:
- At import, on the server:
app/pipeline/lyrics_lookup.py.
- When the Lyrics tab opens on a track with none kept, in the browser:
static/js/lyricsLookup.js (searchLyrics, rankMatches, belongsTo, sameSong, sameArtist and their helpers).
Both decide the same things: which LRCLIB row is this song, whether it is by this artist, which length fits the track. They are written twice, in two languages, and have to be kept equal by hand. When the rule for dropping another song's lyrics changed (#702), it had to change in both.
What goes wrong when they drift: the same track can get lyrics at import and "no lyrics found" in the tab, or the other way round, depending on which side looked first. Only the server can check a match against the vocals, so the browser's answer is also the weaker one.
Constraints for whoever fixes it:
- The server already serves kept lyrics (
GET /api/jobs/{id}/lyrics). The tab could ask the server to look them up instead of calling LRCLIB itself.
- LRCLIB must still be reached only when the Lyrics tab is opened or at import, never on its own, as the privacy note in the Lyrics panel says.
- The browser's parsing and display helpers (
parseLrc, wordTimings, shiftLines, voicedPhrases) are not part of this. The tab and Sync lines need them either way.
- A mobile or offline client should still show kept lyrics.
Found while reviewing the size of #713.
StemDeck looks lyrics up on LRCLIB in two separate places:
app/pipeline/lyrics_lookup.py.static/js/lyricsLookup.js(searchLyrics,rankMatches,belongsTo,sameSong,sameArtistand their helpers).Both decide the same things: which LRCLIB row is this song, whether it is by this artist, which length fits the track. They are written twice, in two languages, and have to be kept equal by hand. When the rule for dropping another song's lyrics changed (#702), it had to change in both.
What goes wrong when they drift: the same track can get lyrics at import and "no lyrics found" in the tab, or the other way round, depending on which side looked first. Only the server can check a match against the vocals, so the browser's answer is also the weaker one.
Constraints for whoever fixes it:
GET /api/jobs/{id}/lyrics). The tab could ask the server to look them up instead of calling LRCLIB itself.parseLrc,wordTimings,shiftLines,voicedPhrases) are not part of this. The tab and Sync lines need them either way.Found while reviewing the size of #713.