mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-10 14:14:19 +00:00
commit
4ea81af0ac
3 changed files with 23 additions and 0 deletions
|
@ -467,6 +467,23 @@ class Mood(MediaTag):
|
|||
FILTER = 'mood'
|
||||
|
||||
|
||||
@utils.registerPlexObject
|
||||
class Poster(PlexObject):
|
||||
""" Represents a Poster.
|
||||
|
||||
Attributes:
|
||||
TAG (str): 'Photo'
|
||||
"""
|
||||
TAG = 'Photo'
|
||||
|
||||
def _loadData(self, data):
|
||||
self._data = data
|
||||
self.key = data.attrib.get('key')
|
||||
self.ratingKey = data.attrib.get('ratingKey')
|
||||
self.selected = data.attrib.get('selected')
|
||||
self.thumb = data.attrib.get('thumb')
|
||||
|
||||
|
||||
@utils.registerPlexObject
|
||||
class Producer(MediaTag):
|
||||
""" Represents a single Producer media tag.
|
||||
|
|
|
@ -89,6 +89,11 @@ class Video(PlexPartialObject):
|
|||
""" Returns str, default title for a new syncItem. """
|
||||
return self.title
|
||||
|
||||
def posters(self):
|
||||
""" Returns list of available poster objects. :class:`~plexapi.media.Poster`:"""
|
||||
|
||||
return self.fetchItems('%s/posters' % self.key, cls=media.Poster)
|
||||
|
||||
def sync(self, videoQuality, client=None, clientId=None, limit=None, unwatched=False, title=None):
|
||||
""" Add current video (movie, tv-show, season or episode) as sync item for specified device.
|
||||
See :func:`plexapi.myplex.MyPlexAccount.sync()` for possible exceptions.
|
||||
|
|
|
@ -101,6 +101,7 @@ def test_video_Movie_attrs(movies):
|
|||
assert [i.tag for i in movie.directors] == ['Nina Paley']
|
||||
assert movie.duration >= 160000
|
||||
assert movie.fields == []
|
||||
assert movie.posters()
|
||||
assert sorted([i.tag for i in movie.genres]) == ['Animation', 'Comedy', 'Fantasy', 'Musical', 'Romance']
|
||||
assert movie.guid == 'com.plexapp.agents.imdb://tt1172203?lang=en'
|
||||
assert utils.is_metadata(movie._initpath)
|
||||
|
|
Loading…
Reference in a new issue