Skip to content

Conversation

@sel10ut
Copy link

@sel10ut sel10ut commented Mar 21, 2025

Description

There are situations when there are multiple best matches, but the first one only has plain lyrics, while others include synced, but are also exactly or closely matched. It appears to be that the results are sorted by id or date added.

This PR adds an optional parameter that enables soft prioritization logic, the ability to order lyrics by using a trivial ORDER BY clause and existing DB columns has_synced_lyrics and has_plain_lyrics. It simply elevates the chosen kind to the top while keeping the match ranking and initial sort. If tracks with the chosen kind don't exist, the other kinds will be the top result as is.

This logic could also be implemented without the parameter and enabled by default to prioritize synced lyrics. However, there are possibilities where it could mess up the search result if the user's query is not specific and relevant enough. It may give unrelated tracks that have synced lyrics.

Closes #28 #10

* Adds 'prioritize' parameter to '/get' and '/search' routes.
It adds the ability to elevate synced or plain lyrics in results.
This is useful, for example, for ordering tracks with synced
lyrics first.
@aviwad
Copy link

aviwad commented Mar 26, 2025

Very much required. I am oftentimes getting plain lyrics when I can go on lrclib.net and see that synced lyrics exist!!

@Brannan-repo
Copy link

When using the /api/get call you will get both plainLyrics and syncedLyrics, either of which can be empty/null. If the synced lyrics exist then you'll write them to a .lrc file to be loaded by your music app, otherwise you can embed the plainLyrics directly into the mp3 file.
Would that fix the issue?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specifying scyned or plain lyrics in get endpoint support

3 participants