Add playlist method to plexapi.library.LibrarySection

This commit is contained in:
JonnyWong16 2020-10-01 14:40:12 -07:00
parent 478c4540b1
commit d1172f4975
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -769,6 +769,11 @@ class MovieSection(LibrarySection):
""" Returns a list of collections from this library section. """
return self.search(libtype='collection', **kwargs)
def playlist(self, **kwargs):
""" Returns a list of playlists from this library section. """
key = '/playlists?type=15&playlistType=%s&sectionID=%s' % (self.CONTENT_TYPE, self.key)
return self.fetchItems(key)
def sync(self, videoQuality, limit=None, unwatched=False, **kwargs):
""" Add current Movie library section as sync item for specified device.
See description of :func:`plexapi.library.LibrarySection.search()` for details about filtering / sorting and
@ -849,6 +854,11 @@ class ShowSection(LibrarySection):
""" Returns a list of collections from this library section. """
return self.search(libtype='collection', **kwargs)
def playlist(self, **kwargs):
""" Returns a list of playlists from this library section. """
key = '/playlists?type=15&playlistType=%s&sectionID=%s' % (self.CONTENT_TYPE, self.key)
return self.fetchItems(key)
def sync(self, videoQuality, limit=None, unwatched=False, **kwargs):
""" Add current Show library section as sync item for specified device.
See description of :func:`plexapi.library.LibrarySection.search()` for details about filtering / sorting and
@ -930,6 +940,11 @@ class MusicSection(LibrarySection):
""" Returns a list of collections from this library section. """
return self.search(libtype='collection', **kwargs)
def playlist(self, **kwargs):
""" Returns a list of playlists from this library section. """
key = '/playlists?type=15&playlistType=%s&sectionID=%s' % (self.CONTENT_TYPE, self.key)
return self.fetchItems(key)
def sync(self, bitrate, limit=None, **kwargs):
""" Add current Music library section as sync item for specified device.
See description of :func:`plexapi.library.LibrarySection.search()` for details about filtering / sorting and
@ -991,6 +1006,11 @@ class PhotoSection(LibrarySection):
""" Search for a photo. See :func:`~plexapi.library.LibrarySection.search()` for usage. """
return self.search(libtype='photo', title=title, **kwargs)
def playlist(self, **kwargs):
""" Returns a list of playlists from this library section. """
key = '/playlists?type=15&playlistType=%s&sectionID=%s' % (self.CONTENT_TYPE, self.key)
return self.fetchItems(key)
def sync(self, resolution, limit=None, **kwargs):
""" Add current Music library section as sync item for specified device.
See description of :func:`plexapi.library.LibrarySection.search()` for details about filtering / sorting and