From 899d2fbf9dfd4cd0d1dfe5bd9739905f708361d2 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Fri, 10 Apr 2020 14:03:32 -0700 Subject: [PATCH] Make library delete server_id optional --- plexpy/libraries.py | 3 ++- plexpy/users.py | 3 ++- plexpy/webserve.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plexpy/libraries.py b/plexpy/libraries.py index 79e520ba..1cdf54b0 100644 --- a/plexpy/libraries.py +++ b/plexpy/libraries.py @@ -1040,7 +1040,8 @@ class Libraries(object): purge_only=purge_only)) 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) if purge_only: return True diff --git a/plexpy/users.py b/plexpy/users.py index cf61db0c..55f04c19 100644 --- a/plexpy/users.py +++ b/plexpy/users.py @@ -676,7 +676,8 @@ class Users(object): success = [] 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) elif str(user_id).isdigit(): diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 6292e1fa..7389ceaa 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -915,10 +915,10 @@ class WebInterface(object): ``` Required parameters: - server_id (str): The Plex server identifier of the library section section_id (str): The id of the Plex library section 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" Returns: @@ -944,10 +944,10 @@ class WebInterface(object): ``` Required parameters: - server_id (str): The Plex server identifier of the library section section_id (str): The id of the Plex library section 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" Returns: