mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 19:53:17 +00:00
zomg...
This commit is contained in:
parent
389cc5a30a
commit
26bf4ca010
3 changed files with 6 additions and 7 deletions
|
@ -58,7 +58,6 @@ class Photoalbum(PlexPartialObject):
|
||||||
return album
|
return album
|
||||||
raise NotFound('Unable to find album: %s' % title)
|
raise NotFound('Unable to find album: %s' % title)
|
||||||
|
|
||||||
|
|
||||||
def photos(self, **kwargs):
|
def photos(self, **kwargs):
|
||||||
""" Returns a list of :class:`~plexapi.photo.Photo` objects in this album. """
|
""" Returns a list of :class:`~plexapi.photo.Photo` objects in this album. """
|
||||||
key = '/library/metadata/%s/children' % self.ratingKey
|
key = '/library/metadata/%s/children' % self.ratingKey
|
||||||
|
|
|
@ -34,13 +34,13 @@ class Playlist(PlexPartialObject, Playable):
|
||||||
self.updatedAt = toDatetime(data.attrib.get('updatedAt'))
|
self.updatedAt = toDatetime(data.attrib.get('updatedAt'))
|
||||||
self._items = None # cache for self.items
|
self._items = None # cache for self.items
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self): # pragma: no cover
|
||||||
return len(self.items())
|
return len(self.items())
|
||||||
|
|
||||||
def __contains__(self, other):
|
def __contains__(self, other): # pragma: no cover
|
||||||
return any(i.key == other.key for i in self.items())
|
return any(i.key == other.key for i in self.items())
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key): # pragma: no cover
|
||||||
return self.items()[key]
|
return self.items()[key]
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
|
@ -57,7 +57,7 @@ class Playlist(PlexPartialObject, Playable):
|
||||||
items = [items]
|
items = [items]
|
||||||
ratingKeys = []
|
ratingKeys = []
|
||||||
for item in items:
|
for item in items:
|
||||||
if item.listType != self.playlistType:
|
if item.listType != self.playlistType: # pragma: no cover
|
||||||
raise BadRequest('Can not mix media types when building a playlist: %s and %s' %
|
raise BadRequest('Can not mix media types when building a playlist: %s and %s' %
|
||||||
(self.playlistType, item.listType))
|
(self.playlistType, item.listType))
|
||||||
ratingKeys.append(str(item.ratingKey))
|
ratingKeys.append(str(item.ratingKey))
|
||||||
|
@ -108,7 +108,7 @@ class Playlist(PlexPartialObject, Playable):
|
||||||
items = [items]
|
items = [items]
|
||||||
ratingKeys = []
|
ratingKeys = []
|
||||||
for item in items:
|
for item in items:
|
||||||
if item.listType != items[0].listType:
|
if item.listType != items[0].listType: # pragma: no cover
|
||||||
raise BadRequest('Can not mix media types when building a playlist')
|
raise BadRequest('Can not mix media types when building a playlist')
|
||||||
ratingKeys.append(str(item.ratingKey))
|
ratingKeys.append(str(item.ratingKey))
|
||||||
ratingKeys = ','.join(ratingKeys)
|
ratingKeys = ','.join(ratingKeys)
|
||||||
|
|
Loading…
Reference in a new issue