Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: trim .ext from title to optimize query. #52

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

YanceyChiew
Copy link
Contributor

The unexpected . field in the title directly
corrupts local.go:findFile, so that the last part
of the title never accurately matches the lrc file.


I'm using Rhythmbox to play local music and the lyrics are also local. Then I noticed that for files with missing metatags, sptlrx always confused different songs by the same artist.

After debugging, I found that the reason is that Rhythmbox will use the file name together with its extension as the fall-back title, and when matching local lyrics, the extension will be processed and glued together with another part at the end of the file name -- usually the real title of the song.

This means that unless this mechanism is known in advance and all lyric files are renamed accordingly, accurate matching is impossible to occur for a player like Rhythmbox.

This fix may also introduce new issues with certain file/player combinations, such as when the song title contains a dot but the url does not contain the file extension. But I think this situation should be rare enough.


Maybe it would be better to put meta["xesam:url"] into the player.State structure, so that local.go can compare the file extensions by itself, and also get the accurate lrc file with the same name based on the url without configuring the lyrics directory.

The unexpected .<ext> field in the title directly
corrupts local.go:findFile, so that the last part
of the title never accurately matches the lrc file.
@raitonoberu raitonoberu merged commit c03f1cb into raitonoberu:master Jul 23, 2024
@raitonoberu
Copy link
Owner

Works great, thank you!

Maybe it would be better to put meta["xesam:url"] into the player.State structure, so that local.go can compare the file extensions by itself, and also get the accurate lrc file with the same name based on the url without configuring the lyrics directory.

I agree. I'm planning a big rewrite of the project that will improve such scenarios (and maybe even allow us to use embedded lyrics), but those are just plans.

@YanceyChiew
Copy link
Contributor Author

I agree. I'm planning a big rewrite of the project that will improve such scenarios (and maybe even allow us to use embedded lyrics), but those are just plans.

Sounds great, looking forward to new features coming!

@YanceyChiew YanceyChiew deleted the local_fix_best_file branch July 23, 2024 20:09
@sanderr
Copy link

sanderr commented Jul 30, 2024

Maybe it would be better to put meta["xesam:url"] into the player.State structure, so that local.go can compare the file extensions by itself, and also get the accurate lrc file with the same name based on the url without configuring the lyrics directory.

@YanceyChiew you may be interested to know that I made a PR for this in #53.

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.

3 participants