update LibrarySection's edit method to include agent if not provided

should allow for edits that are not agent changes to be easier
This commit is contained in:
blacktwin 2020-03-16 11:56:16 -04:00
parent cfbde385e2
commit 4a7aac16be

View file

@ -366,13 +366,15 @@ class LibrarySection(PlexObject):
log.error(msg)
raise
def edit(self, **kwargs):
def edit(self, agent=None, **kwargs):
""" Edit a library (Note: agent is required). See :class:`~plexapi.library.Library` for example usage.
Parameters:
kwargs (dict): Dict of settings to edit.
"""
part = '/library/sections/%s?%s' % (self.key, urlencode(kwargs))
if not agent:
agent = self.agent
part = '/library/sections/%s?agent=%s&%s' % (self.key, agent, urlencode(kwargs))
self._server.query(part, method=self._server._session.put)
# Reload this way since the self.key dont have a full path, but is simply a id.