mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 21:21:15 -07:00
Update plexapi.video.Clip and plexapi.photo.Photoalbum
This commit is contained in:
parent
6e41b7ef3d
commit
36f877c7ff
2 changed files with 13 additions and 4 deletions
|
@ -38,7 +38,7 @@ class Photoalbum(PlexPartialObject):
|
||||||
self.composite = data.attrib.get('composite')
|
self.composite = data.attrib.get('composite')
|
||||||
self.guid = data.attrib.get('guid')
|
self.guid = data.attrib.get('guid')
|
||||||
self.index = utils.cast(int, data.attrib.get('index'))
|
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.librarySectionID = data.attrib.get('librarySectionID')
|
||||||
self.librarySectionKey = data.attrib.get('librarySectionKey')
|
self.librarySectionKey = data.attrib.get('librarySectionKey')
|
||||||
self.librarySectionTitle = data.attrib.get('librarySectionTitle')
|
self.librarySectionTitle = data.attrib.get('librarySectionTitle')
|
||||||
|
@ -75,6 +75,11 @@ class Photoalbum(PlexPartialObject):
|
||||||
return photo
|
return photo
|
||||||
raise NotFound('Unable to find photo: %s' % title)
|
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
|
@utils.registerPlexObject
|
||||||
class Photo(PlexPartialObject):
|
class Photo(PlexPartialObject):
|
||||||
|
|
|
@ -750,12 +750,15 @@ class Clip(Playable, Video):
|
||||||
METADATA_TYPE = 'clip'
|
METADATA_TYPE = 'clip'
|
||||||
|
|
||||||
def _loadData(self, data):
|
def _loadData(self, data):
|
||||||
|
""" Load attribute values from Plex XML response. """
|
||||||
|
Video._loadData(self, data)
|
||||||
|
Playable._loadData(self, data)
|
||||||
self._data = data
|
self._data = data
|
||||||
self.addedAt = data.attrib.get('addedAt')
|
self.addedAt = data.attrib.get('addedAt')
|
||||||
self.duration = data.attrib.get('duration')
|
self.duration = utils.cast(int, data.attrib.get('duration'))
|
||||||
self.guid = data.attrib.get('guid')
|
self.guid = data.attrib.get('guid')
|
||||||
self.key = data.attrib.get('key')
|
self.key = data.attrib.get('key')
|
||||||
self.originallyAvailableAt = data.attrib.get('originallyAvailableAt')
|
self.originallyAvailableAt = utils.toDatetime(data.attrib.get('originallyAvailableAt'), '%Y-%m-%d')
|
||||||
self.ratingKey = data.attrib.get('ratingKey')
|
self.ratingKey = data.attrib.get('ratingKey')
|
||||||
self.skipDetails = utils.cast(int, data.attrib.get('skipDetails'))
|
self.skipDetails = utils.cast(int, data.attrib.get('skipDetails'))
|
||||||
self.subtype = data.attrib.get('subtype')
|
self.subtype = data.attrib.get('subtype')
|
||||||
|
@ -763,4 +766,5 @@ class Clip(Playable, Video):
|
||||||
self.thumbAspectRatio = data.attrib.get('thumbAspectRatio')
|
self.thumbAspectRatio = data.attrib.get('thumbAspectRatio')
|
||||||
self.title = data.attrib.get('title')
|
self.title = data.attrib.get('title')
|
||||||
self.type = data.attrib.get('type')
|
self.type = data.attrib.get('type')
|
||||||
self.year = data.attrib.get('year')
|
self.year = utils.cast(int, data.attrib.get('year'))
|
||||||
|
self.media = self.findItems(data, media.Media)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue