jacquesh / foo_openlyrics

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

Forward slash '/' in %title% creates a folder #244

Closed b0nk closed 1 year ago

b0nk commented 1 year ago

Forward slash '/' in %title% creates a folder and a file in the lyrics directory

Steps to reproduce

  1. Play a track with a title containing a '/' example "foo/bar"
  2. Save lyrics using the default scheme "[%artist% - ][%title%]"
  3. Notice the lyrics directory now has a new folder with "ArtistName - foo" and inside it a file called "bar.txt"

Expected behavior

The slash in the filename should be replaced by another character (example "ArtistName - foo_bar.txt")

Versions

Additional information

I am using foobar on linux under wine

regorxxx commented 1 year ago

I don't consider this a bug at all, and applying a "fix" to a behavior intended by design (since this is how TF works) would be counterproductive, unless it's clearly documented/optional. You should replace yourself those chars via TF. https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_Reference#.24replace.28str.2Csearch.2Creplace.29

That's how it works on every other plugin or instance where TF is used, so don't really understand what you were expecting here... and all other lyrics plugins work the same.

jacquesh commented 1 year ago

Thanks for the help @regorxxx, I'm content to point people to that as a workaround (I just wasn't sure if titleformat provided a nice way to do it).

b0nk commented 1 year ago

So I replaced the file name format like so: [%artist% - ]$replace(%title%, '/', '_') and it still creates a folder.

The example in the picture: Streetlight Manifesto - Point/Counterpoint

out

What am I doing wrong here?

b0nk commented 1 year ago

Nevermind, I can't use spaces or apostrophes This one works: [%artist% - ]$replace(%title%,/,_)

regorxxx commented 1 year ago

My recommendation: $ascii($replace(%title%,\,,/,))