mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-25 13:10:17 +00:00
Add episodeNumber property
This commit is contained in:
parent
158c5f5633
commit
b27e12c5d9
1 changed files with 9 additions and 4 deletions
|
@ -644,7 +644,7 @@ class Season(Video, ArtMixin, PosterMixin, CollectionMixin):
|
|||
|
||||
@property
|
||||
def seasonNumber(self):
|
||||
""" Returns season number. """
|
||||
""" Returns the season number. """
|
||||
return self.index
|
||||
|
||||
def episodes(self, **kwargs):
|
||||
|
@ -833,17 +833,22 @@ class Episode(Video, Playable, ArtMixin, PosterMixin, CollectionMixin, DirectorM
|
|||
"""
|
||||
return [part.file for part in self.iterParts() if part]
|
||||
|
||||
@property
|
||||
def episodeNumber(self):
|
||||
""" Returns the episode number. """
|
||||
return self.index
|
||||
|
||||
@property
|
||||
def seasonNumber(self):
|
||||
""" Returns the episodes season number. """
|
||||
""" Returns the episode's season number. """
|
||||
if self._seasonNumber is None:
|
||||
self._seasonNumber = self.parentIndex if self.parentIndex else self.season().seasonNumber
|
||||
return utils.cast(int, self._seasonNumber)
|
||||
|
||||
@property
|
||||
def seasonEpisode(self):
|
||||
""" Returns the s00e00 string containing the season and episode. """
|
||||
return 's%se%s' % (str(self.seasonNumber).zfill(2), str(self.index).zfill(2))
|
||||
""" Returns the s00e00 string containing the season and episode numbers. """
|
||||
return 's%se%s' % (str(self.seasonNumber).zfill(2), str(self.episodeNumber).zfill(2))
|
||||
|
||||
@property
|
||||
def hasIntroMarker(self):
|
||||
|
|
Loading…
Reference in a new issue