Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add label methods, properties to Episodes #868

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion plexapi/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ def _defaultSyncTitle(self):

@utils.registerPlexObject
class Episode(Video, Playable, ArtMixin, PosterMixin, RatingMixin,
CollectionMixin, DirectorMixin, WriterMixin):
CollectionMixin, DirectorMixin, LabelMixin, WriterMixin):
""" Represents a single Shows Episode.

Attributes:
Expand All @@ -733,6 +733,7 @@ class Episode(Video, Playable, ArtMixin, PosterMixin, RatingMixin,
grandparentTitle (str): Name of the show for the episode.
guids (List<:class:`~plexapi.media.Guid`>): List of guid objects.
index (int): Episode number.
labels (List<:class:`~plexapi.media.Label`>): List of label objects.
markers (List<:class:`~plexapi.media.Marker`>): List of marker objects.
media (List<:class:`~plexapi.media.Media`>): List of media objects.
originallyAvailableAt (datetime): Datetime the episode was released.
Expand Down Expand Up @@ -777,6 +778,7 @@ def _loadData(self, data):
self.grandparentTitle = data.attrib.get('grandparentTitle')
self.guids = self.findItems(data, media.Guid)
self.index = utils.cast(int, data.attrib.get('index'))
glensc marked this conversation as resolved.
Show resolved Hide resolved
self.labels = self.findItems(data, media.Label)
self.markers = self.findItems(data, media.Marker)
self.media = self.findItems(data, media.Media)
self.originallyAvailableAt = utils.toDatetime(data.attrib.get('originallyAvailableAt'), '%Y-%m-%d')
Expand Down
1 change: 1 addition & 0 deletions tests/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,7 @@ def test_video_Episode_mixins_tags(episode):
test_mixins.edit_collection(episode)
test_mixins.edit_director(episode)
test_mixins.edit_writer(episode)
test_mixins.edit_label(episode)


def test_video_Episode_media_tags(episode):
Expand Down