check for valid paths in addLocation and removeLocation methods

This commit is contained in:
blacktwin 2021-12-18 23:48:53 -05:00
parent ba490c7f67
commit 7e14d2d315

View file

@ -493,7 +493,8 @@ class LibrarySection(PlexObject):
else: else:
locations.append(location) locations.append(location)
for path in locations: 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) self.edit(location=locations)
def removeLocations(self, location): def removeLocations(self, location):
@ -517,7 +518,8 @@ class LibrarySection(PlexObject):
else: else:
locations.remove(location) locations.remove(location)
for path in locations: 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) self.edit(location=locations)
def get(self, title): def get(self, title):