From 64f647e12bb0c3286e33182f5761f7686a7d1ff7 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sun, 9 May 2021 21:17:37 -0700 Subject: [PATCH] Add addition season and episode attributes * Season.parentStudio * Season.year * Episode.parentYear --- plexapi/video.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plexapi/video.py b/plexapi/video.py index 6279334d..75a3bcdc 100644 --- a/plexapi/video.py +++ b/plexapi/video.py @@ -600,10 +600,12 @@ class Season(Video, ArtMixin, PosterMixin, CollectionMixin): parentIndex (int): Plex index number for the show. parentKey (str): API URL of the show (/library/metadata/). parentRatingKey (int): Unique key identifying the show. + parentStudio (str): Studio that created show. parentTheme (str): URL to show theme resource (/library/metadata//theme/). parentThumb (str): URL to show thumbnail image (/library/metadata//thumb/). parentTitle (str): Name of the show for the season. viewedLeafCount (int): Number of items marked as played in the season view. + year (int): Year the season was released. """ TAG = 'Directory' TYPE = 'season' @@ -618,13 +620,15 @@ class Season(Video, ArtMixin, PosterMixin, CollectionMixin): self.key = self.key.replace('/children', '') # FIX_BUG_50 self.leafCount = utils.cast(int, data.attrib.get('leafCount')) self.parentGuid = data.attrib.get('parentGuid') - self.parentIndex = data.attrib.get('parentIndex') + self.parentIndex = utils.cast(int, data.attrib.get('parentIndex')) self.parentKey = data.attrib.get('parentKey') self.parentRatingKey = utils.cast(int, data.attrib.get('parentRatingKey')) + self.parentStudio = data.attrib.get('parentStudio') self.parentTheme = data.attrib.get('parentTheme') self.parentThumb = data.attrib.get('parentThumb') self.parentTitle = data.attrib.get('parentTitle') self.viewedLeafCount = utils.cast(int, data.attrib.get('viewedLeafCount')) + self.year = utils.cast(int, data.attrib.get('year')) def __iter__(self): for episode in self.episodes(): @@ -751,12 +755,13 @@ class Episode(Video, Playable, ArtMixin, PosterMixin, CollectionMixin, DirectorM parentRatingKey (int): Unique key identifying the season. parentThumb (str): URL to season thumbnail image (/library/metadata//thumb/). parentTitle (str): Name of the season for the episode. + parentYear (int): Year the season was released. rating (float): Episode rating (7.9; 9.8; 8.1). skipParent (bool): True if the show's seasons are set to hidden. userRating (float): User rating (2.0; 8.0). viewOffset (int): View offset in milliseconds. writers (List<:class:`~plexapi.media.Writer`>): List of writers objects. - year (int): Year episode was released. + year (int): Year the episode was released. """ TAG = 'Video' TYPE = 'episode' @@ -793,6 +798,7 @@ class Episode(Video, Playable, ArtMixin, PosterMixin, CollectionMixin, DirectorM self.parentRatingKey = utils.cast(int, data.attrib.get('parentRatingKey')) self.parentThumb = data.attrib.get('parentThumb') self.parentTitle = data.attrib.get('parentTitle') + self.parentYear = utils.cast(int, data.attrib.get('parentYear')) self.rating = utils.cast(float, data.attrib.get('rating')) self.skipParent = utils.cast(bool, data.attrib.get('skipParent', '0')) self.userRating = utils.cast(float, data.attrib.get('userRating'))