Add art and thumb url to plexapi collections
This commit is contained in:
@@ -1092,6 +1092,7 @@ class Collections(PlexObject):
|
||||
def _loadData(self, data):
|
||||
self.ratingKey = utils.cast(int, data.attrib.get('ratingKey'))
|
||||
self._details_key = "/library/metadata/%s%s" % (self.ratingKey, self._include)
|
||||
self.art = data.attrib.get('art')
|
||||
self.contentRating = data.attrib.get('contentRating')
|
||||
self.guid = data.attrib.get('guid')
|
||||
self.key = data.attrib.get('key')
|
||||
@@ -1118,6 +1119,16 @@ class Collections(PlexObject):
|
||||
def children(self):
|
||||
return self.fetchItems(self.key)
|
||||
|
||||
@property
|
||||
def thumbUrl(self):
|
||||
""" Return the thumbnail url for the collection."""
|
||||
return self._server.url(self.thumb, includeToken=True) if self.thumb else None
|
||||
|
||||
@property
|
||||
def artUrl(self):
|
||||
""" Return the art url for the collection."""
|
||||
return self._server.url(self.art, includeToken=True) if self.art else None
|
||||
|
||||
def __len__(self):
|
||||
return self.childCount
|
||||
|
||||
|
Reference in New Issue
Block a user