create settings method for LibrarySection

return current library settings
This commit is contained in:
blacktwin 2020-03-16 11:12:28 -04:00
parent 8d334ce47f
commit 1d05304643

View file

@ -4,6 +4,7 @@ from plexapi.base import PlexObject
from plexapi.compat import unquote, urlencode, quote_plus from plexapi.compat import unquote, urlencode, quote_plus
from plexapi.media import MediaTag from plexapi.media import MediaTag
from plexapi.exceptions import BadRequest, NotFound from plexapi.exceptions import BadRequest, NotFound
from plexapi.settings import Setting
class Library(PlexObject): class Library(PlexObject):
@ -401,6 +402,12 @@ class LibrarySection(PlexObject):
key = '/library/sections/%s/all%s' % (self.key, sortStr) key = '/library/sections/%s/all%s' % (self.key, sortStr)
return self.fetchItems(key, **kwargs) return self.fetchItems(key, **kwargs)
def settings(self):
""" Returns a list of all library settings. """
key = '/library/sections/%s/prefs' % self.key
data = self._server.query(key)
return self.findItems(data, cls=Setting)
def onDeck(self): def onDeck(self):
""" Returns a list of media items on deck from this library section. """ """ Returns a list of media items on deck from this library section. """
key = '/library/sections/%s/onDeck' % self.key key = '/library/sections/%s/onDeck' % self.key