Feature: Add source property to playlist items to support remote playlist entries
Description
A Playlist entry if added a remote server item has field "source" initialized with value like server://<server_id>/com.plexapp.plugins.library
The source attribute should be on
- [x] Movie
- [x] Episode
- [ ] Track
- [ ] Photo.
Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [x] This change requires a documentation update
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated the docstring for new or existing methods
- [ ] I have added tests when applicable
here's diff of keys local vs remote playlist entries. i guess some fields like titleSort rather vary on whether item has sort title set.
--- pl-local-keys.json 2024-01-08 03:38:13
+++ pl-remote-keys.json 2024-01-08 03:38:28
@@ -6,17 +6,17 @@
"duration",
"guid",
"key",
- "librarySectionID", // local
- "librarySectionKey", // local
- "librarySectionTitle", // local
+ "originalTitle", // remote
"originallyAvailableAt",
"playlistItemID",
"ratingKey",
+ "source", // remote
"studio",
"summary",
+ "tagline", // remote
"thumb",
"title",
+ "titleSort", // remote
"type",
- "updatedAt", // local
"year"
]
This is unforunate, this seems to conflict with History object:
File "/home/runner/work/python-plexapi/python-plexapi/tests/test_history.py", line 93, in test_history_PlexHistory
assert hist.source() == movie
TypeError: 'NoneType' object is not callable
- https://github.com/pkkid/python-plexapi/actions/runs/7442362354/job/20245688665?pr=1335#step:12:793
as apparently History extends from Movie object (class MovieHistory(PlexHistory, Movie):
- https://github.com/pkkid/python-plexapi/pull/1185
What is a "remote playlist entry"? Do you mean on someone else's server? What is the Plex URL endpoint where we can see this source attribute?
Remote playlist is when you add item to playlist, but choose different server.
This seems to be available only when I'm on server that I don't own, and have at least one server that I own.
the source attribute is seen with the existing get playlist api call:
p = server.playlist("Playlist Name")
source = p._data.attrib.get("source")
so, http://localhost:32400/playlists/<ratingKey>/items
The source attribute should be on Movie, Episode, Track, and Photo.
I need to think about what to do about the conflicting PlexSession.source() and PlexHistory.source() methods.
Added to Track c4c2d03 and Photo b439ea8
maybe add this new property with the name "remote_source"?
I think we name the attribute sourceURI and don't change the methods.
References:
https://github.com/pkkid/python-plexapi/blob/b51aa1924b5b28ba61aefbb4162aff6e6864561b/plexapi/server.py#L172-L173
https://github.com/pkkid/python-plexapi/blob/b51aa1924b5b28ba61aefbb4162aff6e6864561b/plexapi/playqueue.py#L27
Updated: 3d7fd9e215861715d871c81cc80fca100be97462
no longer breaking change label