Author Topic: API Request: Subsonic - Playlist(s) API  (Read 3789 times)

jalabulajunx

  • Newbie
  • *
  • Posts: 8
Hello, Steve -

This is a follow-up post from here on the request for APIs on creating and modifying Playlists from Subsonic Plugin.  I have written down the requirements in a user story/gherkin format. Let me know if you have any questions.

For Create Playlist(s)

As a user, I would like to create a playlist of songs within my Subsonic server, so that I can access it anywhere on various clients

Saving the playlist
Given that users have selected one or more songs that are part of Subsonic
When they invoke an option to save it as a playlists
Then they should be provided with a way to save the playlist on Subsonic server

Options while saving the playlists
Given that users have selected songs to save as playlists
When they invoke option to save
Then they are provided with options to enter a name, description and private/public flag for the Playlist

For Editing and Modifying Playlists' attributes

As a user who owns the playlists, I would like to edit and modify playlists' name, description and/or the private/public flag, so that I control the playlists

User who owns the playlists
Given that user selected a playlist
When they edit the Playlist
Then they should see an option to edit its attributes - Name, Description, and Flag.

User who does not own the playlists - Shared playlists
Given that the user selects playlists
When they try to edit the playlists
Then they do not see options to modify any of the attributes


For Deleting Playlist(s)

As a user, I would like to delete a playlist I own, so that I have a complete control on my playlists.

User who owns the playlists
Given that user selected a playlist
When they delete the Playlist
Then they are presented with a confirmation for deletion
And upon confirmation, the playlists get deleted from the Subsonic server

User who does not own the playlists - Shared playlists
Given that the user selects playlists
When they try to delete the playlists
Then they do not see an option to delete the playlists


For modifying the contents of the playlist(s)

As a user who owns the playlists, I should be able to modify the contents of the playlists, i.e., add or remove songs from the playlist so that I can customize and publish the playlists to be accessible across devices

Removing
Given that user selects the playlists
When they view the songs that make up the playlist
Then they see an option to remove one or more songs from the playlists (either right-click or other means) on Subsonic
//Per Subsonic API, the remove takes the index of the song within the playlist and not the songId.


Adding
Given that user is viewing an album or a playlist of songs
When they right click on the song/songs
Then they see an option to add the songs to the playlists on Subsonic server
//Per Subsonic API, the add takes the songId.

Non-owners
Given that users who do not own the playlist views it
When they right-click a song/songs
Then they do not see an option to remove songs from the playlist they do not own on Subsonic
And they do not see an option to add songs to a playlist they do not own on Subsonic

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 34416
I have had a look at whats involved and i think its too much of a change involved for me to do at this point in time.
It would be possible for you to implement many of these functions by building custom context menu items
eg. select some files, right click, "Delete from Playlist" which would be a custom context menu item you would have set up from within your plugin that calls code in your plugin.
You could do the same for creating a new playlist and for adding files to a playlist.
Have a look at the tag tools plugin because i think boroda74 has custom context menu items.
If you are still interested and have questions i can provide some more detail how it would be implemented.
I would also be ok to enhance the custom context menu items a bit eg. to provide you with a way to know what the active tab is showing which you could use to hide context menu items that dont apply