diff --git a/plexapi/library.py b/plexapi/library.py index d0bb7228..fd4c5b8a 100644 --- a/plexapi/library.py +++ b/plexapi/library.py @@ -454,12 +454,14 @@ class LibrarySection(PlexObject): if not agent: agent = self.agent + locations = [] if kwargs['location']: - paths = kwargs.get('location') - for path in paths: + for path in kwargs['location']: if not self._server.isBrowsable(path): raise BadRequest('Path: %s does not exist.' % path) - params = list(kwargs.items()) + locations = [('location', path) for path in kwargs.pop('location')] + + params = list(kwargs.items()) + locations part = '/library/sections/%s?agent=%s&%s' % (self.key, agent, urlencode(params, doseq=True)) self._server.query(part, method=self._server._session.put)