From b27e12c5d9d8ce9f05119716b9d227623e459c36 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Mon, 10 May 2021 17:56:06 -0700 Subject: [PATCH] Add episodeNumber property --- plexapi/video.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plexapi/video.py b/plexapi/video.py index 6279334d..dd4f63fd 100644 --- a/plexapi/video.py +++ b/plexapi/video.py @@ -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):