Update plexapi.video.Clip and plexapi.photo.Photoalbum

This commit is contained in:
JonnyWong16 2020-10-04 01:18:05 -07:00
parent 6e41b7ef3d
commit 36f877c7ff
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 13 additions and 4 deletions

View file

@ -38,7 +38,7 @@ class Photoalbum(PlexPartialObject):
self.composite = data.attrib.get('composite')
self.guid = data.attrib.get('guid')
self.index = utils.cast(int, data.attrib.get('index'))
self.key = data.attrib.get('key')
self.key = data.attrib.get('key', '').replace('/children', '')
self.librarySectionID = data.attrib.get('librarySectionID')
self.librarySectionKey = data.attrib.get('librarySectionKey')
self.librarySectionTitle = data.attrib.get('librarySectionTitle')
@ -75,6 +75,11 @@ class Photoalbum(PlexPartialObject):
return photo
raise NotFound('Unable to find photo: %s' % title)
def clips(self, **kwargs):
""" Returns a list of :class:`~plexapi.video.Clip` objects in this album. """
key = '/library/metadata/%s/children' % self.ratingKey
return self.fetchItems(key, etag='Video', **kwargs)
@utils.registerPlexObject
class Photo(PlexPartialObject):