From 1126ef4a61c11513f2c85e2805a711052f8d19b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 8 Jan 2024 04:00:08 +0200 Subject: [PATCH 01/11] Add source property to Video A Playlist entry if added a remote server item has field "source" initialized with value like `server:///com.plexapp.plugins.library` --- plexapi/video.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plexapi/video.py b/plexapi/video.py index 4a66c0a4f..b1b7eb5fc 100644 --- a/plexapi/video.py +++ b/plexapi/video.py @@ -369,6 +369,7 @@ class Movie( ratings (List<:class:`~plexapi.media.Rating`>): List of rating objects. roles (List<:class:`~plexapi.media.Role`>): List of role objects. similar (List<:class:`~plexapi.media.Similar`>): List of Similar objects. + source (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) studio (str): Studio that created movie (Di Bonaventura Pictures; 21 Laps Entertainment). tagline (str): Movie tag line (Back 2 Work; Who says men can't change?). theme (str): URL to theme resource (/library/metadata//theme/). @@ -412,6 +413,7 @@ def _loadData(self, data): self.ratings = self.findItems(data, media.Rating) self.roles = self.findItems(data, media.Role) self.similar = self.findItems(data, media.Similar) + self.source = data.attrib.get('source') # remote playlist item self.studio = data.attrib.get('studio') self.tagline = data.attrib.get('tagline') self.theme = data.attrib.get('theme') From 65aba84626626d039ecf80ac0ffc2772b1bbb786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 8 Jan 2024 04:05:10 +0200 Subject: [PATCH 02/11] Add source to Episode --- plexapi/video.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plexapi/video.py b/plexapi/video.py index b1b7eb5fc..832d5ab40 100644 --- a/plexapi/video.py +++ b/plexapi/video.py @@ -900,6 +900,7 @@ class Episode( ratings (List<:class:`~plexapi.media.Rating`>): List of rating objects. roles (List<:class:`~plexapi.media.Role`>): List of role objects. skipParent (bool): True if the show's seasons are set to hidden. + source (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) viewOffset (int): View offset in milliseconds. writers (List<:class:`~plexapi.media.Writer`>): List of writers objects. year (int): Year the episode was released. @@ -942,6 +943,7 @@ def _loadData(self, data): self.ratings = self.findItems(data, media.Rating) self.roles = self.findItems(data, media.Role) self.skipParent = utils.cast(bool, data.attrib.get('skipParent', '0')) + self.source = data.attrib.get('source') # remote playlist item self.viewOffset = utils.cast(int, data.attrib.get('viewOffset', 0)) self.writers = self.findItems(data, media.Writer) self.year = utils.cast(int, data.attrib.get('year')) From 90da1ba6eeaeec366792d4ee9c49e24141607699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 8 Jan 2024 04:07:33 +0200 Subject: [PATCH 03/11] Fix flake8 error E261 at least two spaces before inline comment --- plexapi/video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plexapi/video.py b/plexapi/video.py index 832d5ab40..4344988d5 100644 --- a/plexapi/video.py +++ b/plexapi/video.py @@ -413,7 +413,7 @@ def _loadData(self, data): self.ratings = self.findItems(data, media.Rating) self.roles = self.findItems(data, media.Role) self.similar = self.findItems(data, media.Similar) - self.source = data.attrib.get('source') # remote playlist item + self.source = data.attrib.get('source') # remote playlist item self.studio = data.attrib.get('studio') self.tagline = data.attrib.get('tagline') self.theme = data.attrib.get('theme') @@ -943,7 +943,7 @@ def _loadData(self, data): self.ratings = self.findItems(data, media.Rating) self.roles = self.findItems(data, media.Role) self.skipParent = utils.cast(bool, data.attrib.get('skipParent', '0')) - self.source = data.attrib.get('source') # remote playlist item + self.source = data.attrib.get('source') # remote playlist item self.viewOffset = utils.cast(int, data.attrib.get('viewOffset', 0)) self.writers = self.findItems(data, media.Writer) self.year = utils.cast(int, data.attrib.get('year')) From c4c2d03998c73f03e31cea08bf047740c1eb89e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 14 Jan 2024 23:53:42 +0200 Subject: [PATCH 04/11] Add source to Track --- plexapi/audio.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plexapi/audio.py b/plexapi/audio.py index 10ba97689..1fbe5c732 100644 --- a/plexapi/audio.py +++ b/plexapi/audio.py @@ -449,6 +449,7 @@ class Track( primaryExtraKey (str) API URL for the primary extra for the track. ratingCount (int): Number of listeners who have scrobbled this track, as reported by Last.fm. skipCount (int): Number of times the track has been skipped. + source (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) viewOffset (int): View offset in milliseconds. year (int): Year the track was released. """ @@ -483,6 +484,7 @@ def _loadData(self, data): self.primaryExtraKey = data.attrib.get('primaryExtraKey') self.ratingCount = utils.cast(int, data.attrib.get('ratingCount')) self.skipCount = utils.cast(int, data.attrib.get('skipCount')) + self.source = data.attrib.get('source') # remote playlist item self.viewOffset = utils.cast(int, data.attrib.get('viewOffset', 0)) self.year = utils.cast(int, data.attrib.get('year')) From b439ea89f716729aab19e94c63ce6d2511cd6c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 14 Jan 2024 23:54:26 +0200 Subject: [PATCH 05/11] Add source to Photo --- plexapi/photo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plexapi/photo.py b/plexapi/photo.py index 8737d814c..58a401d10 100644 --- a/plexapi/photo.py +++ b/plexapi/photo.py @@ -180,6 +180,7 @@ class Photo( parentThumb (str): URL to photo album thumbnail image (/library/metadata//thumb/). parentTitle (str): Name of the photo album for the photo. ratingKey (int): Unique key identifying the photo. + source (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) summary (str): Summary of the photo. tags (List<:class:`~plexapi.media.Tag`>): List of tag objects. thumb (str): URL to thumbnail image (/library/metadata//thumb/). @@ -218,6 +219,7 @@ def _loadData(self, data): self.parentThumb = data.attrib.get('parentThumb') self.parentTitle = data.attrib.get('parentTitle') self.ratingKey = utils.cast(int, data.attrib.get('ratingKey')) + self.source = data.attrib.get('source') # remote playlist item self.summary = data.attrib.get('summary') self.tags = self.findItems(data, media.Tag) self.thumb = data.attrib.get('thumb') From 3d7fd9e215861715d871c81cc80fca100be97462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 11 Feb 2024 18:22:32 +0200 Subject: [PATCH 06/11] Rename the field to sourceURI --- plexapi/audio.py | 4 ++-- plexapi/photo.py | 4 ++-- plexapi/video.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plexapi/audio.py b/plexapi/audio.py index 1fbe5c732..bf9575e58 100644 --- a/plexapi/audio.py +++ b/plexapi/audio.py @@ -449,7 +449,7 @@ class Track( primaryExtraKey (str) API URL for the primary extra for the track. ratingCount (int): Number of listeners who have scrobbled this track, as reported by Last.fm. skipCount (int): Number of times the track has been skipped. - source (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) viewOffset (int): View offset in milliseconds. year (int): Year the track was released. """ @@ -484,7 +484,7 @@ def _loadData(self, data): self.primaryExtraKey = data.attrib.get('primaryExtraKey') self.ratingCount = utils.cast(int, data.attrib.get('ratingCount')) self.skipCount = utils.cast(int, data.attrib.get('skipCount')) - self.source = data.attrib.get('source') # remote playlist item + self.sourceURI = data.attrib.get('source') # remote playlist item self.viewOffset = utils.cast(int, data.attrib.get('viewOffset', 0)) self.year = utils.cast(int, data.attrib.get('year')) diff --git a/plexapi/photo.py b/plexapi/photo.py index 58a401d10..0750599d6 100644 --- a/plexapi/photo.py +++ b/plexapi/photo.py @@ -180,7 +180,7 @@ class Photo( parentThumb (str): URL to photo album thumbnail image (/library/metadata//thumb/). parentTitle (str): Name of the photo album for the photo. ratingKey (int): Unique key identifying the photo. - source (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) summary (str): Summary of the photo. tags (List<:class:`~plexapi.media.Tag`>): List of tag objects. thumb (str): URL to thumbnail image (/library/metadata//thumb/). @@ -219,7 +219,7 @@ def _loadData(self, data): self.parentThumb = data.attrib.get('parentThumb') self.parentTitle = data.attrib.get('parentTitle') self.ratingKey = utils.cast(int, data.attrib.get('ratingKey')) - self.source = data.attrib.get('source') # remote playlist item + self.sourceURI = data.attrib.get('source') # remote playlist item self.summary = data.attrib.get('summary') self.tags = self.findItems(data, media.Tag) self.thumb = data.attrib.get('thumb') diff --git a/plexapi/video.py b/plexapi/video.py index 4344988d5..2a87a628c 100644 --- a/plexapi/video.py +++ b/plexapi/video.py @@ -369,7 +369,7 @@ class Movie( ratings (List<:class:`~plexapi.media.Rating`>): List of rating objects. roles (List<:class:`~plexapi.media.Role`>): List of role objects. similar (List<:class:`~plexapi.media.Similar`>): List of Similar objects. - source (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) studio (str): Studio that created movie (Di Bonaventura Pictures; 21 Laps Entertainment). tagline (str): Movie tag line (Back 2 Work; Who says men can't change?). theme (str): URL to theme resource (/library/metadata//theme/). @@ -413,7 +413,7 @@ def _loadData(self, data): self.ratings = self.findItems(data, media.Rating) self.roles = self.findItems(data, media.Role) self.similar = self.findItems(data, media.Similar) - self.source = data.attrib.get('source') # remote playlist item + self.sourceURI = data.attrib.get('source') # remote playlist item self.studio = data.attrib.get('studio') self.tagline = data.attrib.get('tagline') self.theme = data.attrib.get('theme') @@ -900,7 +900,7 @@ class Episode( ratings (List<:class:`~plexapi.media.Rating`>): List of rating objects. roles (List<:class:`~plexapi.media.Role`>): List of role objects. skipParent (bool): True if the show's seasons are set to hidden. - source (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) viewOffset (int): View offset in milliseconds. writers (List<:class:`~plexapi.media.Writer`>): List of writers objects. year (int): Year the episode was released. @@ -943,7 +943,7 @@ def _loadData(self, data): self.ratings = self.findItems(data, media.Rating) self.roles = self.findItems(data, media.Role) self.skipParent = utils.cast(bool, data.attrib.get('skipParent', '0')) - self.source = data.attrib.get('source') # remote playlist item + self.sourceURI = data.attrib.get('source') # remote playlist item self.viewOffset = utils.cast(int, data.attrib.get('viewOffset', 0)) self.writers = self.findItems(data, media.Writer) self.year = utils.cast(int, data.attrib.get('year')) From 208de0d7c53445548498e4ce7a96615b1061bbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 11 Feb 2024 18:55:13 +0200 Subject: [PATCH 07/11] Update plexapi/audio.py Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> --- plexapi/audio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexapi/audio.py b/plexapi/audio.py index bf9575e58..27ef1481c 100644 --- a/plexapi/audio.py +++ b/plexapi/audio.py @@ -449,7 +449,7 @@ class Track( primaryExtraKey (str) API URL for the primary extra for the track. ratingCount (int): Number of listeners who have scrobbled this track, as reported by Last.fm. skipCount (int): Number of times the track has been skipped. - sourceURI (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) (remote playlist item only) viewOffset (int): View offset in milliseconds. year (int): Year the track was released. """ From 5153eebc2e2724d3d177cb5b3775f19c86f2dc13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 11 Feb 2024 18:55:19 +0200 Subject: [PATCH 08/11] Update plexapi/photo.py Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> --- plexapi/photo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexapi/photo.py b/plexapi/photo.py index 0750599d6..a4ac986b4 100644 --- a/plexapi/photo.py +++ b/plexapi/photo.py @@ -180,7 +180,7 @@ class Photo( parentThumb (str): URL to photo album thumbnail image (/library/metadata//thumb/). parentTitle (str): Name of the photo album for the photo. ratingKey (int): Unique key identifying the photo. - sourceURI (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) (remote playlist item only) summary (str): Summary of the photo. tags (List<:class:`~plexapi.media.Tag`>): List of tag objects. thumb (str): URL to thumbnail image (/library/metadata//thumb/). From b74ae99b6f284a5c699bbace4c728d24f8e51d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 11 Feb 2024 18:55:26 +0200 Subject: [PATCH 09/11] Update plexapi/video.py Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> --- plexapi/video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexapi/video.py b/plexapi/video.py index 2a87a628c..7804a18d7 100644 --- a/plexapi/video.py +++ b/plexapi/video.py @@ -369,7 +369,7 @@ class Movie( ratings (List<:class:`~plexapi.media.Rating`>): List of rating objects. roles (List<:class:`~plexapi.media.Role`>): List of role objects. similar (List<:class:`~plexapi.media.Similar`>): List of Similar objects. - sourceURI (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) (remote playlist item only) studio (str): Studio that created movie (Di Bonaventura Pictures; 21 Laps Entertainment). tagline (str): Movie tag line (Back 2 Work; Who says men can't change?). theme (str): URL to theme resource (/library/metadata//theme/). From 83d1586588a169eea99ce4d93b765c5a888a2255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 11 Feb 2024 18:55:32 +0200 Subject: [PATCH 10/11] Update plexapi/video.py Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> --- plexapi/video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexapi/video.py b/plexapi/video.py index 7804a18d7..f6a923758 100644 --- a/plexapi/video.py +++ b/plexapi/video.py @@ -900,7 +900,7 @@ class Episode( ratings (List<:class:`~plexapi.media.Rating`>): List of rating objects. roles (List<:class:`~plexapi.media.Role`>): List of role objects. skipParent (bool): True if the show's seasons are set to hidden. - sourceURI (str): Remote server URL (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) (remote playlist item only) viewOffset (int): View offset in milliseconds. writers (List<:class:`~plexapi.media.Writer`>): List of writers objects. year (int): Year the episode was released. From af4bfaaba40cd21bea2cdd58ec1b1fda3847c7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 11 Feb 2024 18:59:32 +0200 Subject: [PATCH 11/11] Fix flake line length issue --- plexapi/audio.py | 3 ++- plexapi/photo.py | 3 ++- plexapi/video.py | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plexapi/audio.py b/plexapi/audio.py index 27ef1481c..0c86d16d9 100644 --- a/plexapi/audio.py +++ b/plexapi/audio.py @@ -449,7 +449,8 @@ class Track( primaryExtraKey (str) API URL for the primary extra for the track. ratingCount (int): Number of listeners who have scrobbled this track, as reported by Last.fm. skipCount (int): Number of times the track has been skipped. - sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) + (remote playlist item only). viewOffset (int): View offset in milliseconds. year (int): Year the track was released. """ diff --git a/plexapi/photo.py b/plexapi/photo.py index a4ac986b4..c68b36131 100644 --- a/plexapi/photo.py +++ b/plexapi/photo.py @@ -180,7 +180,8 @@ class Photo( parentThumb (str): URL to photo album thumbnail image (/library/metadata//thumb/). parentTitle (str): Name of the photo album for the photo. ratingKey (int): Unique key identifying the photo. - sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) + (remote playlist item only). summary (str): Summary of the photo. tags (List<:class:`~plexapi.media.Tag`>): List of tag objects. thumb (str): URL to thumbnail image (/library/metadata//thumb/). diff --git a/plexapi/video.py b/plexapi/video.py index f6a923758..9bfabcd4e 100644 --- a/plexapi/video.py +++ b/plexapi/video.py @@ -369,7 +369,8 @@ class Movie( ratings (List<:class:`~plexapi.media.Rating`>): List of rating objects. roles (List<:class:`~plexapi.media.Role`>): List of role objects. similar (List<:class:`~plexapi.media.Similar`>): List of Similar objects. - sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) + (remote playlist item only). studio (str): Studio that created movie (Di Bonaventura Pictures; 21 Laps Entertainment). tagline (str): Movie tag line (Back 2 Work; Who says men can't change?). theme (str): URL to theme resource (/library/metadata//theme/). @@ -900,7 +901,8 @@ class Episode( ratings (List<:class:`~plexapi.media.Rating`>): List of rating objects. roles (List<:class:`~plexapi.media.Role`>): List of role objects. skipParent (bool): True if the show's seasons are set to hidden. - sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) (remote playlist item only) + sourceURI (str): Remote server URI (server:///com.plexapp.plugins.library) + (remote playlist item only). viewOffset (int): View offset in milliseconds. writers (List<:class:`~plexapi.media.Writer`>): List of writers objects. year (int): Year the episode was released.