Skip to content

Lyrics are matched to a song in two places, which can disagree #719

Description

@thcp

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions