Skip to content

Feature: Add source property to playlist items to support remote playlist entries - #1335

Merged
JonnyWong16 merged 11 commits into
pushingkarmaorg:masterfrom
glensc:patch-3
Feb 17, 2024
Merged

Feature: Add source property to playlist items to support remote playlist entries#1335
JonnyWong16 merged 11 commits into
pushingkarmaorg:masterfrom
glensc:patch-3

Conversation

@glensc

@glenscglensc commented Jan 8, 2024

Copy link
Copy Markdown
Contributor

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

  • Movie
  • Episode
  • Track
  • Photo.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have added tests when applicable

A Playlist entry if added a remote server item has field "source" initialized with value like `server://<server_id>/com.plexapp.plugins.library`
@glensc

Copy link
Copy Markdown
ContributorAuthor

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"
]

E261 at least two spaces before inline comment
@glenscglensc changed the title Feature: Add source property to VideoFeature: Add source property to Video/EpisodeJan 8, 2024
@glenscglensc changed the title Feature: Add source property to Video/EpisodeFeature: Add source property to Video/Episode to support remote playlist entriesJan 8, 2024
@glensc

glensc commented Jan 8, 2024

Copy link
Copy Markdown
ContributorAuthor

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

as apparently History extends from Movie object (class MovieHistory(PlexHistory, Movie):

@glensc
glensc marked this pull request as draft January 8, 2024 19:30
@glenscglensc mentioned this pull request Jan 8, 2024
7 tasks
@JonnyWong16

Copy link
Copy Markdown
Collaborator

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?

@glensc

Copy link
Copy Markdown
ContributorAuthor

Remote playlist is when you add item to playlist, but choose different server.

image

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

@JonnyWong16

Copy link
Copy Markdown
Collaborator

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.

@glenscglensc changed the title Feature: Add source property to Video/Episode to support remote playlist entriesFeature: Add source property to playlist items to support remote playlist entriesJan 9, 2024
@glensc

Copy link
Copy Markdown
ContributorAuthor

Added to Track c4c2d03 and Photo b439ea8

@glensc

Copy link
Copy Markdown
ContributorAuthor

maybe add this new property with the name "remote_source"?

@JonnyWong16

Copy link
Copy Markdown
Collaborator

@glensc

Copy link
Copy Markdown
ContributorAuthor

Updated: 3d7fd9e

@glensc
glensc marked this pull request as ready for review February 11, 2024 16:23
Comment threadplexapi/audio.py Outdated
Comment threadplexapi/photo.py Outdated
Comment threadplexapi/video.py Outdated
Comment threadplexapi/video.py Outdated
glenscand others added 4 commits February 11, 2024 18:55
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
@glensc

Copy link
Copy Markdown
ContributorAuthor

no longer breaking change label

@JonnyWong16
JonnyWong16 merged commit 9d9dca8 into pushingkarmaorg:masterFeb 17, 2024
@glensc
glensc deleted the patch-3 branch February 18, 2024 09:48
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@glensc@JonnyWong16