Make library delete server_id optional

This commit is contained in:
JonnyWong16 2020-04-10 14:03:32 -07:00
parent 6a87dc9c40
commit 899d2fbf9d
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
3 changed files with 6 additions and 4 deletions

View file

@ -1040,7 +1040,8 @@ class Libraries(object):
purge_only=purge_only)) purge_only=purge_only))
return all(success) return all(success)
elif server_id and str(section_id).isdigit(): elif str(section_id).isdigit():
server_id = server_id or plexpy.CONFIG.PMS_IDENTIFIER
database.delete_library_history(server_id=server_id, section_id=section_id) database.delete_library_history(server_id=server_id, section_id=section_id)
if purge_only: if purge_only:
return True return True

View file

@ -676,7 +676,8 @@ class Users(object):
success = [] success = []
for user in result: for user in result:
success.append(self.delete(user_id=user['user_id'], purge_only=purge_only)) success.append(self.delete(user_id=user['user_id'],
purge_only=purge_only))
return all(success) return all(success)
elif str(user_id).isdigit(): elif str(user_id).isdigit():

View file

@ -915,10 +915,10 @@ class WebInterface(object):
``` ```
Required parameters: Required parameters:
server_id (str): The Plex server identifier of the library section
section_id (str): The id of the Plex library section section_id (str): The id of the Plex library section
Optional parameters: Optional parameters:
server_id (str): The Plex server identifier of the library section
row_ids (str): Comma separated row ids to delete, e.g. "2,3,8" row_ids (str): Comma separated row ids to delete, e.g. "2,3,8"
Returns: Returns:
@ -944,10 +944,10 @@ class WebInterface(object):
``` ```
Required parameters: Required parameters:
server_id (str): The Plex server identifier of the library section
section_id (str): The id of the Plex library section section_id (str): The id of the Plex library section
Optional parameters: Optional parameters:
server_id (str): The Plex server identifier of the library section
row_ids (str): Comma separated row ids to delete, e.g. "2,3,8" row_ids (str): Comma separated row ids to delete, e.g. "2,3,8"
Returns: Returns: