jacquesh / foo_openlyrics

An open-source lyric display panel for foobar2000
MIT License
442 stars 26 forks source link

Search and fetch local lyrics (.lrc or .txt files) located in same directory as the audio file #422

Open apprenti-sorcier opened 1 day ago

apprenti-sorcier commented 1 day ago

My lyrics have the same file name as the audio tracks, obviously with a different extension. But I can’t switch from Lyric Show 3 to OpenLyrics because the latter is unreliable.

When I set it with %filename%, some of the existent lyrics show this instead of the file content. I don’t see any difference to the other files that are shown fine. 384532299-6f729719-d6ab-4b29-9fd9-3e6ce1032182 All these files are shown fine by the Lyric Show 3. I even removed all the possible Internet sources so that there is no Chinese interference, but it’s not that either. What is the problem ?

Steps to reproduce

Put %filename% instead of the default $replace(…) in the settings (Search sources / Local files / File name format)

Expected behavior

Considering the original setting working on both kinds of formats (.lrc and .txt), I suppose you don’t have to set an extension (actually if you do, it will only work on that one type of format).

Versions

Debug logs

The console doesn’t show anything else but “Opening track for playback: "…"”

For example in this album, all tracks have .lrc files, but tracks 1, 3, 4 ,6, 7, 10, 11 show some Chinese characters, whereas all the others show the .lrc file. In the screen capture, Lyric Show 3 (set with %_filename%) shows the lyrics, whereas OpenLyrics shows gibberish. Image du presse-papiers (126)

apprenti-sorcier commented 1 day ago

I might found a culprit. The .lrc files that show fine are encoded as UTF-8 with no BOM. I converted them to Windows 1252 encoding and lo ! OpenLyrics switches to Chinese gibberish. I converted the tracks that didn’t show fine to UTF-8 (BOM of no BOM) and now they are shown all right in OpenLyrics. So now the problem seems clarified, waiting for a correction please. Thanks in advance.

jacquesh commented 8 hours ago

Ah ok great, thanks. That's....very strange. Just to clarify, you've set "Storage Directory" to "Same directory as the track" and then:

Is that accurate? That's very weird, the name of the file really shouldn't impact the decoding at all (I was going to say it looked like another instance of #364). Could you possibly upload the exact Windows 1252-encoded file, along with the exact name you have the file saved under?