sentriz / gonic

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

Playlist sharing across users #522

Open roobre opened 1 week ago

roobre commented 1 week ago

gonic version: v0.16.4

Hi there! Long time lurker of the Gonic project here, which has now regained some of my interest as recent changes to Jellyfin have unfortunately impacted a core use case for me: playlist sharing. I'm very much not a C# person myself, but I can handle Go just fine. Because of this, I would like to pitch this feature and offer my help to get it done in Gonic!

My current idea is very minimal: Allow a (potentially small) set of users to control playlists they do not own.

I've taken a quick look at the Gonic codebase, and I think this could be implemented on a first iteration by defining a playlist attribute in the likes of

#GONIC-SHARED-WITH 1,3,5

I think this should play nice with the existing attribute parser: https://github.com/sentriz/gonic/blob/0e45f5e84cd650211351179edf3eed89a54c6c75/playlist/playlist.go#L246

With this list unmarshalled, it should hopefully be simple to tap into that list for consuming in https://github.com/sentriz/gonic/blob/0e45f5e84cd650211351179edf3eed89a54c6c75/server/ctrlsubsonic/handlers_playlist.go#L38

and for editing it in https://github.com/sentriz/gonic/blob/0e45f5e84cd650211351179edf3eed89a54c6c75/server/ctrlsubsonic/handlers_playlist.go#L133

To keep the implementation small I was thinking about not exposing a method for granting access to playlists on the first iteration, and instead instruct users to add this comment manually to their m3u files.

Would love to hear your thoughts on this! If you think this could be useful, I'll be happy to spin up a PR with the suggested approach.