Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for playlist edit #76

Merged
merged 3 commits into from
Sep 25, 2022

Conversation

blacklight
Copy link
Collaborator

Closes #75

Known limitations:

  • Bulk removals may be a bit slow because the current API seems to only support one removal per call
  • Additions are always appended to the end of the playlist because that's the only API that seems supported
  • Swapping track positions isn't really supported - a first look at the call made by the Tidal client shows a POST request to the playlist item URL with the toIndex argument, but I haven't found anything like that in the tidalapi package

@blacklight
Copy link
Collaborator Author

blacklight commented Sep 11, 2022

Any volunteers who would like to test this PR? @tehkillerbee @2e0byo @fmarzocca

I have been doing playlist edits for the past few days without issues, tested both from ncmpcpp, Iris and M.A.L.P. However, all these clients are also compatible with the limitations of the current implementation - only support for "Add to playlist" (i.e. append at the end, not in the middle), and swapping only works with adjacent tracks so we can get away with a DELETE followed by a POST. I'd be interested to know how things work with other clients though.

@tehkillerbee
Copy link
Owner

@blacklight Definitely. I can only test with Iris, as this is what I currently. If there are other clients you suggest testing with, I'll give it a try.

@tehkillerbee
Copy link
Owner

tehkillerbee commented Sep 11, 2022

@blacklight First initial tests:

  1. Adding to existing playlist in Iris does not seem to work; "Action failed (addTracksToPlaylist)
    Not supported on this type of object"
  2. Creating new playlist and then adding tracks to it works great.
  3. Deleting new playlists, existing playlists works, although playlist view must be refreshed manually.
  4. Existing playlists are not always shown in the "Add to playlist" dropdown. It seems the playlists must be browsed/created before they appear.

@2e0byo
Copy link
Collaborator

2e0byo commented Sep 11, 2022

@tehkillerbee I think 4 is just a limitation of iris in general. I'm up for testing this, though I too only use iris! I'll pull it down in a bit.

@tehkillerbee
Copy link
Owner

tehkillerbee commented Sep 11, 2022

@tehkillerbee I think 4 is just a limitation of iris in general. I'm up for testing this, though I too only use iris! I'll pull it down in a bit.

After further testing, I noticed the playlists provided as m3u files do show up automatically. So I wonder how they are populated in Iris. Tidal playlists only show up if added manually or when browsing them individually

@blacklight
Copy link
Collaborator Author

@tehkillerbee I think some work is required on mopidy-iris side as well.

At a first look, it seems that Iris inspect the can_edit attribute on the Playlist object to tell whether a user can create a playlist of that type, or add/remove tracks into it.

An entry exists for Spotify - one should probably be added for Tidal as well.

Besides that, playlist editing, creation and deletion seems to work quite well over MPD. I mostly use the mopidy-mpd backend to connect to MPD clients, and I have tested playlist edit mostly through ncmpcpp and mpc command-line commands. mopidy-mobile also works by the way, since it's a bit less opinionated than Iris about what playlists can actually be edited.

@tehkillerbee
Copy link
Owner

@blacklight Since this is mainly an Iris Issue, I think we can merge this PR and add it to the Iris todo list.

Copy link
Owner

@tehkillerbee tehkillerbee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, with isort errors

@tehkillerbee tehkillerbee merged commit cdbf5b1 into tehkillerbee:master Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for playlist modifications
4 participants