we are unable to remove all locations from a library

the result of posting this request is nothing
to reduce confusion add a check for locations size after removals
This commit is contained in:
blacktwin 2021-12-19 22:05:58 -05:00
parent d1b190375a
commit 5cf95e53d0

View file

@ -521,7 +521,8 @@ class LibrarySection(PlexObject):
locations.remove(_location)
else:
raise BadRequest('Path: %s does not exist in the library.' % location)
if len(locations) == 0:
raise BadRequest('You are unable to remove all locations from a library.' % location)
self.edit(location=locations)
def get(self, title):