Skip to content

Commit 1d05304

Browse files
committed
create settings method for LibrarySection
return current library settings
1 parent 8d334ce commit 1d05304

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plexapi/library.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from plexapi.compat import unquote, urlencode, quote_plus
55
from plexapi.media import MediaTag
66
from plexapi.exceptions import BadRequest, NotFound
7+
from plexapi.settings import Setting
78

89

910
class Library(PlexObject):
@@ -401,6 +402,12 @@ def all(self, sort=None, **kwargs):
401402
key = '/library/sections/%s/all%s' % (self.key, sortStr)
402403
return self.fetchItems(key, **kwargs)
403404

405+
def settings(self):
406+
""" Returns a list of all library settings. """
407+
key = '/library/sections/%s/prefs' % self.key
408+
data = self._server.query(key)
409+
return self.findItems(data, cls=Setting)
410+
404411
def onDeck(self):
405412
""" Returns a list of media items on deck from this library section. """
406413
key = '/library/sections/%s/onDeck' % self.key

0 commit comments

Comments
 (0)