mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-25 13:10:17 +00:00
check for valid paths in addLocation and removeLocation methods
This commit is contained in:
parent
ba490c7f67
commit
7e14d2d315
1 changed files with 4 additions and 2 deletions
|
@ -493,7 +493,8 @@ class LibrarySection(PlexObject):
|
|||
else:
|
||||
locations.append(location)
|
||||
for path in locations:
|
||||
self._server.isBrowsable(path)
|
||||
if not self._server.isBrowsable(path):
|
||||
raise BadRequest('Path: %s does not exist.' % path)
|
||||
self.edit(location=locations)
|
||||
|
||||
def removeLocations(self, location):
|
||||
|
@ -517,7 +518,8 @@ class LibrarySection(PlexObject):
|
|||
else:
|
||||
locations.remove(location)
|
||||
for path in locations:
|
||||
self._server.isBrowsable(path)
|
||||
if not self._server.isBrowsable(path):
|
||||
raise BadRequest('Path: %s does not exist.' % path)
|
||||
self.edit(location=locations)
|
||||
|
||||
def get(self, title):
|
||||
|
|
Loading…
Reference in a new issue