File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -925,11 +925,9 @@ def parentThumb(self):
925925 @cached_property
926926 def _season (self ):
927927 """ Returns the :class:`~plexapi.video.Season` object by querying for the show's children. """
928- if not self .grandparentKey :
929- return None
930- return self .fetchItem (
931- f'{ self .grandparentKey } /children?excludeAllLeaves=1&index={ self .parentIndex } '
932- )
928+ if self .grandparentKey and self .parentIndex is not None :
929+ return self .fetchItem (f'{ self .grandparentKey } /children?excludeAllLeaves=1&index={ self .parentIndex } ' )
930+ return None
933931
934932 def __repr__ (self ):
935933 return '<{}>' .format (
@@ -967,7 +965,11 @@ def episodeNumber(self):
967965 @cached_property
968966 def seasonNumber (self ):
969967 """ Returns the episode's season number. """
970- return self .parentIndex if isinstance (self .parentIndex , int ) else self ._season .seasonNumber
968+ if isinstance (self .parentIndex , int ):
969+ return self .parentIndex
970+ elif self ._season :
971+ return self ._season .index
972+ return None
971973
972974 @property
973975 def seasonEpisode (self ):
You can’t perform that action at this time.
0 commit comments