sentriz / gonic

music streaming server / free-software subsonic server API implementation
ircs://irc.libera.chat/#gonic
GNU General Public License v3.0
1.62k stars 115 forks source link

Add `-playlists-relative` option #537

Open 0chroma opened 2 months ago

0chroma commented 2 months ago

Fixes #529

Improves portability between machines by optionally making file paths relative to the playlist

feedback welcome! it's my first time writing go

sentriz commented 2 months ago

hm I wonder do we need the config option at all? can we just allow relative paths? joining on the basedir if the playlist line doesn't look absolute with no leading slash

0chroma commented 2 months ago

the option mostly determines if the playlist is written with absolute or relative paths, I modified the reader so it does exactly what you described regardless of config option

0chroma commented 2 months ago

If you'd like I can remove the config check during writes from the PR, but I think there's a lot of situations where absolute paths would still make sense (ie having playlists and music on separate volumes)

0chroma commented 1 month ago

heya, just checking in. Let me know if you'd like this merged in!