diff --git a/lib/plexapi/library.py b/lib/plexapi/library.py index 51ef1ecc..8f18abec 100644 --- a/lib/plexapi/library.py +++ b/lib/plexapi/library.py @@ -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§ionID=%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§ionID=%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§ionID=%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§ionID=%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