create hasIntroMarker method to quickly identify if an episode has an intro marker

This commit is contained in:
blacktwin 2020-05-24 22:57:02 -04:00
parent 5e3dff4e32
commit a2ef4a5564

View file

@ -740,6 +740,13 @@ class Episode(Playable, Video):
""" Returns the s00e00 string containing the season and episode. """
return 's%se%s' % (str(self.seasonNumber).zfill(2), str(self.index).zfill(2))
@property
def hasIntroMarker(self):
""" Returns True if this episode has an intro marker in the xml. """
if not self.isFullObject():
self.reload()
return bool(self.markers)
def season(self):
"""" Return this episodes :func:`~plexapi.video.Season`.. """
return self.fetchItem(self.parentKey)