LMS-Community / slimserver

Server for Squeezebox and compatible players. This server is also called Lyrion Music Server.
https://lyrion.org
Other
1.2k stars 296 forks source link

[FR] Add option for relative paths in playlists #959

Open edgar-vincent opened 10 months ago

edgar-vincent commented 10 months ago

Hello!

Thanks a lot for this excellent piece of software. I don't think it has ever been surpassed.

I usually edit M3U playlists with LMS and occasionally play them with other players. Because LMS stores paths of music files in their absolute form, it is currently not possible to use them with others players which have different directory mappings (which is common, for instance, in the case of Docker containers, i.e /foo/music/track.flac could be /bar/music/track.flac in a different container).

One can convert the paths to their relative form in the M3U file, which LMS does recognise, but if they are later modified within LMS, the paths are converted to absolute again.

Would it be possible to add an option specifying whether playlist paths should be absolute or relative?

Thanks a lot!

Moonbase59 commented 4 months ago

+1 on that. The relative path should (must?) be considered relative to the storage location of the playlist file, not relative to the current working directory!

So if I have my music in

~/Musik/Tagged/albumartist/album/title.ext

and my playlist in

~/Musik/Playlists/Radio/playlist.m3u
~/Musik/Playlists/Squeezebox/playlist.m3u

the corresponding playlist entry would be

../../Tagged/10cc/10cc - The Original Soundtrack/10cc - I'm Not in Love.mp3

Cross-device relative references are not possible except on Linux/MacOS, where you can mount a drive anywhere into the path, and everything is just a file, starting at root /.

This allows to always find the tracks based on the playlist location, and is standard behaviour.