jacquesh / foo_openlyrics

An open-source lyric display panel for foobar2000
MIT License
401 stars 24 forks source link

"/" in title or artist will cause inaccessible folder and lrc file in explorer #297

Closed CannonFodderEX closed 10 months ago

CannonFodderEX commented 10 months ago

Steps to reproduce

  1. search lyric for a music with "/" in its title, such as "遺サレタ場所 / 斜光"
  2. open lyrics will create a folder named "岡部啓一(MONACA) - 遺サレタ場所 " and " 斜光.lrc" as its content
  3. windows explorer can't delete, rename, move or copy the created folder.
  4. open lyrics can still load the .lrc file when foobar2000 plays the music.
  5. foobar2000 console will log WARN-OpenLyrics: Failed to open lyric file directory: 2 when trying to open file location

Expected behavior

Normally, open lyrics should create a single file named like "岡部啓一(MONACA) - 遺サレタ場所 / 斜光.lrc", and replace the "/" with other valid character, right? Not only "/", all invalid characters for file system should be replaced.

Versions

Debug logs

I guess this obvious bug don't need any more debug logs other than the one I said in steps to reproduce.

Additional information

jacquesh commented 10 months ago

The fact that it creates a folder is expected behaviour using the current default settings (see #244). However since you are not at all the first person to run into this, I've made a note to change the default filename format to include replacing / with some other valid character like dash or underscore. That'll probably be in the next release.

The fact that the created directory is difficult to delete is a known bug that is fixed for the next release. Take a look at #273 for discussion and a workaround.