Add episodeNumber property

This commit is contained in:
JonnyWong16 2021-05-10 17:56:06 -07:00
parent 158c5f5633
commit b27e12c5d9
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -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):