fix: trim .ext from title to optimize query.#52
fix: trim .ext from title to optimize query.#52raitonoberu merged 1 commit intoraitonoberu:masterfrom
Conversation
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.
|
Works great, thank you!
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 you may be interested to know that I made a PR for this in #53. |
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.