Closed xxxserxxx closed 6 months ago
interesting. what happens then when the admin goes to edit the playlist then
havent tried but I think it end up making a copy of it or something when you go to update
I don't know; I'm not using a client that allows editing the playlist, but from a quick scan of the code CreateOrSave handler reloads all the playlists and only constructs a new file path if it doesn't find a matching playlist. I believe if Admin edits an existing playlist from the parent playlist directory, it'll actually edit the playlist and not create a new one.
c.f. server/ctrlsubsonic/handlers_playlist.go#78
, where it tries to load the playlist by ID using this same Load()
function. The user ID doesn't come into play unless the playlist is new, in which case SaveCreateOrUpdatePlaylist()
creates a new playlist path using the user ID on line 104.
What I'm not sure about is what happens when Gonic encounters duplicate playlists names -- although, this is already an issue if 3 different users all create playlists with the same name, and mark them all GLOBAL.
thanks, seems to work fine. as for muliple playlists with the same name, i think its fine since they have unique ids that match the filesystem
This is carrying on from the various tickets under which playlists have been discussed.
For reasons well-known (#306, #311, #307, #311... but mainly #306), the Subsonic API forces playlists to be by user ID. The solution in gonic was to expect a directory layout with
<playlistpath>/<userid>/.../<whatever>.m3u
. This is inconvenient for users for whom gonic is not the only application using the playlist directory, and maybe not even the main one, an inconvenience exacerbated by the fact thatfs.DirEntry.IsDir()
returns false for directory symlinks.This extremely trivial change does one thing: instead of throwing an error when the directory structure does not contain user IDs as the second element in the path, it merely adds those playlists to the admin's playlist list. This change has two impacts:
What it accomplishes is that it allows gonic to share playlists with all of the other non-Subsonic apps that don't put playlists into int-named subdirectories.