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 saving remote playlist items #1409

Closed
glensc opened this issue May 2, 2024 · 6 comments · Fixed by #1411
Closed

Support saving remote playlist items #1409

glensc opened this issue May 2, 2024 · 6 comments · Fixed by #1411

Comments

@glensc
Copy link
Contributor

glensc commented May 2, 2024

What is your feature request?

Reverse to #1335

Able to add remote server items to playlist.

I've inspected Network tab in browser, and it seems to make this PUT request (urldecoded for readability)

  • http://localhost:32314/playlists/<playlist_id>/items?uri=server://<server_id>/com.plexapp.plugins.library/library/metadata/<key>

Are there any workarounds?

No response

Code Snippets

No response

Additional Context

No response

@glensc
Copy link
Contributor Author

glensc commented May 3, 2024

I wonder how can you mix two servers in same request

For single server it's:

  • items?uri=server://<server_id>/com.plexapp.plugins.library/library/metadata/<key1>,<key2>

repeat uri?

  • items?uri=server://<server1_id>/com.plexapp.plugins.library/library/metadata/<key1>,<key2>&uri=server://<server2_id>/com.plexapp.plugins.library/library/metadata/<key3>,<key4>

@JonnyWong16
Copy link
Collaborator

My guess is Plex won't allow adding items from different servers in the same API call. You probably need to add from one server at a time.

@glensc
Copy link
Contributor Author

glensc commented May 3, 2024

With multiple calls, how can I ensure the order? Seems to become overly complex if need to split to multiple calls.

@glensc
Copy link
Contributor Author

glensc commented May 3, 2024

Could do move, so every "other server" items need to be moved:

in above example I moved foreign server entry.

I foresee already problem with their implementation if they use key (and no server) as primary key in the playlist, i.e collision of same key value from different servers.

lucky guess, maybe bulk move also works:

@JonnyWong16
Copy link
Collaborator

I don't see any way to add items from multiple servers at the same time in Plex Web. The only way I can find to select items from multiple servers is using different hubs pinned on the homepage, but the "Add to Playlist" button disappears as soon as you multi-select from different servers. I really don't think Plex allows this in one single API call.

You would need to make two separate API calls:

PUT http://localhost:32314/playlists/<playlist_id>/items?uri=server://<server1_id>/com.plexapp.plugins.library/library/metadata/<key1>,<key2>
PUT http://localhost:32314/playlists/<playlist_id>/items?uri=server://<server2_id>/com.plexapp.plugins.library/library/metadata/<key3>,<key4>

Which results in the order <key1>, <key2>, <key3>, <key4>.

If you want <key1>, <key3>, <key2>, <key4>, then you would need to make 4 API calls.

We could handle multiple server item ordering automatically internally in the PlexAPI library (i.e. make the separate API calls for the user).

@JonnyWong16
Copy link
Collaborator

Try #1411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants