diff --git a/unmanic/webserver/api_v2/base_api_handler.py b/unmanic/webserver/api_v2/base_api_handler.py index d5031f2f..ceafa97e 100644 --- a/unmanic/webserver/api_v2/base_api_handler.py +++ b/unmanic/webserver/api_v2/base_api_handler.py @@ -244,7 +244,7 @@ async def action_route(self): route.get("call_method"), params["path_args"], params["path_kwargs"]), exc_info=True) - getattr(self, route.get("call_method"))(*params["path_args"], **params["path_kwargs"]) + await getattr(self, route.get("call_method"))(*params["path_args"], **params["path_kwargs"]) return # This route matches the current request URI and does not have any params. @@ -252,7 +252,7 @@ async def action_route(self): tornado.log.app_log.debug("Routing API to {}.{}()".format(self.__class__.__name__, route.get("call_method")), exc_info=True) self.route = route - getattr(self, route.get("call_method"))() + await getattr(self, route.get("call_method"))() return if matched_route_with_unsupported_method: diff --git a/unmanic/webserver/api_v2/docs_api.py b/unmanic/webserver/api_v2/docs_api.py index 6d1cbfe2..e834eca4 100644 --- a/unmanic/webserver/api_v2/docs_api.py +++ b/unmanic/webserver/api_v2/docs_api.py @@ -64,7 +64,7 @@ def initialize(self, **kwargs): udq = UnmanicDataQueues() self.unmanic_data_queues = udq.get_unmanic_data_queues() - def get_privacy_policy(self): + async def get_privacy_policy(self): """ Docs - read privacy policy --- @@ -127,7 +127,7 @@ def get_privacy_policy(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_logs_as_zip(self): + async def get_logs_as_zip(self): """ Docs - get log files as zip --- diff --git a/unmanic/webserver/api_v2/filebrowser_api.py b/unmanic/webserver/api_v2/filebrowser_api.py index a02245f4..eaaa4049 100644 --- a/unmanic/webserver/api_v2/filebrowser_api.py +++ b/unmanic/webserver/api_v2/filebrowser_api.py @@ -59,7 +59,7 @@ def initialize(self, **kwargs): udq = UnmanicDataQueues() self.unmanic_data_queues = udq.get_unmanic_data_queues() - def fetch_directory_listing(self): + async def fetch_directory_listing(self): """ Filebrowser - List files and/or subdirectories in a given directory --- diff --git a/unmanic/webserver/api_v2/history_api.py b/unmanic/webserver/api_v2/history_api.py index f28be583..1fe32416 100644 --- a/unmanic/webserver/api_v2/history_api.py +++ b/unmanic/webserver/api_v2/history_api.py @@ -79,7 +79,7 @@ def initialize(self, **kwargs): self.unmanic_data_queues = udq.get_unmanic_data_queues() self.config = config.Config() - def get_completed_tasks(self): + async def get_completed_tasks(self): """ History - list tasks --- @@ -159,7 +159,7 @@ def get_completed_tasks(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def delete_completed_tasks(self): + async def delete_completed_tasks(self): """ History - delete --- @@ -220,7 +220,7 @@ def delete_completed_tasks(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def add_completed_tasks_to_pending_list(self): + async def add_completed_tasks_to_pending_list(self): """ History - reprocess --- @@ -291,7 +291,7 @@ def add_completed_tasks_to_pending_list(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_completed_task_log(self): + async def get_completed_task_log(self): """ History - details --- diff --git a/unmanic/webserver/api_v2/notifications_api.py b/unmanic/webserver/api_v2/notifications_api.py index 2ed74a5e..f65d1637 100644 --- a/unmanic/webserver/api_v2/notifications_api.py +++ b/unmanic/webserver/api_v2/notifications_api.py @@ -66,7 +66,7 @@ def initialize(self, **kwargs): self.unmanic_data_queues = udq.get_unmanic_data_queues() self.config = config.Config() - def get_notifications(self): + async def get_notifications(self): """ Notifications - read --- @@ -123,7 +123,7 @@ def get_notifications(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def remove_notifications(self): + async def remove_notifications(self): """ Notifications - delete --- diff --git a/unmanic/webserver/api_v2/pending_api.py b/unmanic/webserver/api_v2/pending_api.py index 5d4022a1..710be6d4 100644 --- a/unmanic/webserver/api_v2/pending_api.py +++ b/unmanic/webserver/api_v2/pending_api.py @@ -107,7 +107,7 @@ def initialize(self, **kwargs): udq = UnmanicDataQueues() self.unmanic_data_queues = udq.get_unmanic_data_queues() - def get_pending_tasks(self): + async def get_pending_tasks(self): """ Pending - list tasks --- @@ -182,7 +182,7 @@ def get_pending_tasks(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def delete_pending_tasks(self): + async def delete_pending_tasks(self): """ Pending - delete --- @@ -243,7 +243,7 @@ def delete_pending_tasks(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def trigger_library_rescan(self): + async def trigger_library_rescan(self): """ Pending - trigger a library scan --- @@ -300,7 +300,7 @@ def trigger_library_rescan(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def reorder_pending_tasks(self): + async def reorder_pending_tasks(self): """ Pending - reorder --- @@ -361,7 +361,7 @@ def reorder_pending_tasks(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def create_task_from_path(self): + async def create_task_from_path(self): """ Pending - create --- @@ -445,7 +445,7 @@ def create_task_from_path(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_pending_status_of_tasks(self): + async def get_pending_status_of_tasks(self): """ Pending - get status of tasks --- @@ -513,7 +513,7 @@ def get_pending_status_of_tasks(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def set_pending_status_as_ready(self): + async def set_pending_status_as_ready(self): """ Pending - set status as ready --- @@ -574,7 +574,7 @@ def set_pending_status_as_ready(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def set_pending_library_by_name(self): + async def set_pending_library_by_name(self): """ Pending - set the library of a list of given tasks --- @@ -638,7 +638,7 @@ def set_pending_library_by_name(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def gen_download_link_pending_task_file(self, task_id=None): + async def gen_download_link_pending_task_file(self, task_id=None): """ Pending - request a link for downloading a task file --- @@ -709,7 +709,7 @@ def gen_download_link_pending_task_file(self, task_id=None): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def gen_download_link_pending_task_data(self, task_id=None): + async def gen_download_link_pending_task_data(self, task_id=None): """ Pending - request a link for downloading a task data --- diff --git a/unmanic/webserver/api_v2/plugins_api.py b/unmanic/webserver/api_v2/plugins_api.py index 0ac13f3d..5530edc2 100644 --- a/unmanic/webserver/api_v2/plugins_api.py +++ b/unmanic/webserver/api_v2/plugins_api.py @@ -143,7 +143,7 @@ def initialize(self, **kwargs): udq = UnmanicDataQueues() self.unmanic_data_queues = udq.get_unmanic_data_queues() - def get_installed_plugins(self): + async def get_installed_plugins(self): """ Plugins - list installed plugins --- @@ -218,7 +218,7 @@ def get_installed_plugins(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def enable_plugins(self): + async def enable_plugins(self): """ Plugins - enable --- @@ -271,7 +271,7 @@ def enable_plugins(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def disable_plugins(self): + async def disable_plugins(self): """ Plugins - disable --- @@ -324,7 +324,7 @@ def disable_plugins(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def update_plugins(self): + async def update_plugins(self): """ Plugins - update --- @@ -385,7 +385,7 @@ def update_plugins(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def remove_plugins(self): + async def remove_plugins(self): """ Plugins - remove --- @@ -446,7 +446,7 @@ def remove_plugins(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_plugin_info(self): + async def get_plugin_info(self): """ Plugins - return a requested plugin's metadata and settings --- @@ -525,7 +525,7 @@ def get_plugin_info(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def update_plugin_settings(self): + async def update_plugin_settings(self): """ Plugins - Save the settings of a single plugin --- @@ -590,7 +590,7 @@ def update_plugin_settings(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def reset_plugin_settings(self): + async def reset_plugin_settings(self): """ Plugins - Reset the settings of a single plugin --- @@ -654,7 +654,7 @@ def reset_plugin_settings(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_installable_plugin_list(self): + async def get_installable_plugin_list(self): """ Plugins - Read all installable plugins --- @@ -709,7 +709,7 @@ def get_installable_plugin_list(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def install_plugin_by_id(self): + async def install_plugin_by_id(self): """ Plugins - Install a single plugin by its Plugin ID --- @@ -770,7 +770,7 @@ def install_plugin_by_id(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_plugin_types_with_flows(self): + async def get_plugin_types_with_flows(self): """ Plugins - Get a list of all plugin types that have flows --- @@ -824,7 +824,7 @@ def get_plugin_types_with_flows(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_enabled_plugins_flow_by_type(self): + async def get_enabled_plugins_flow_by_type(self): """ Plugins - Get the plugin flow for a requested plugin type --- @@ -888,7 +888,7 @@ def get_enabled_plugins_flow_by_type(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def save_enabled_plugin_flow(self): + async def save_enabled_plugin_flow(self): """ Plugins - Save the plugin flow for a requested plugin type --- @@ -951,7 +951,7 @@ def save_enabled_plugin_flow(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def update_repo_list(self): + async def update_repo_list(self): """ Plugins - Update the plugin repo list --- @@ -1012,7 +1012,7 @@ def update_repo_list(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_repo_list(self): + async def get_repo_list(self): """ Plugins - Read all configured plugin repos --- @@ -1067,7 +1067,7 @@ def get_repo_list(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def reload_repo_data(self): + async def reload_repo_data(self): """ Plugins - Reload plugin repositories remote data --- @@ -1119,7 +1119,7 @@ def reload_repo_data(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_enabled_panel_plugins_list(self): + async def get_enabled_panel_plugins_list(self): """ Plugins - Read all enabled "data panel" type plugins --- diff --git a/unmanic/webserver/api_v2/session_api.py b/unmanic/webserver/api_v2/session_api.py index 56cf9df5..7a64f8d4 100644 --- a/unmanic/webserver/api_v2/session_api.py +++ b/unmanic/webserver/api_v2/session_api.py @@ -69,7 +69,7 @@ def initialize(self, **kwargs): udq = UnmanicDataQueues() self.unmanic_data_queues = udq.get_unmanic_data_queues() - def get_session_state(self): + async def get_session_state(self): """ Session - state --- @@ -132,7 +132,7 @@ def get_session_state(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def session_reload(self): + async def session_reload(self): """ Session - reload --- @@ -184,7 +184,7 @@ def session_reload(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def session_logout(self): + async def session_logout(self): """ Session - log out of session --- diff --git a/unmanic/webserver/api_v2/settings_api.py b/unmanic/webserver/api_v2/settings_api.py index ba79bf64..51caa6f7 100644 --- a/unmanic/webserver/api_v2/settings_api.py +++ b/unmanic/webserver/api_v2/settings_api.py @@ -147,7 +147,7 @@ def initialize(self, **kwargs): self.unmanic_data_queues = udq.get_unmanic_data_queues() self.config = config.Config() - def get_all_settings(self): + async def get_all_settings(self): """ Settings - read --- @@ -201,7 +201,7 @@ def get_all_settings(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def write_settings(self): + async def write_settings(self): """ Settings - save a dictionary of settings --- @@ -272,7 +272,7 @@ def write_settings(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_system_configuration(self): + async def get_system_configuration(self): """ Settings - read the system configuration --- @@ -328,7 +328,7 @@ def get_system_configuration(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def validate_remote_installation(self): + async def validate_remote_installation(self): """ Settings - validate a remote installation address --- @@ -398,7 +398,7 @@ def validate_remote_installation(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_all_worker_groups(self): + async def get_all_worker_groups(self): """ Settings - get list of all worker groups --- @@ -452,7 +452,7 @@ def get_all_worker_groups(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def read_worker_group_config(self): + async def read_worker_group_config(self): """ Settings - read the configuration of a worker group --- @@ -526,7 +526,7 @@ def read_worker_group_config(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def write_worker_group_config(self): + async def write_worker_group_config(self): """ Settings - write the configuration of a worker group --- @@ -586,7 +586,7 @@ def write_worker_group_config(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def remove_worker_group(self): + async def remove_worker_group(self): """ Settings - remove a worker group --- @@ -651,7 +651,7 @@ def remove_worker_group(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def read_link_config(self): + async def read_link_config(self): """ Settings - read the configuration of a remote installation link --- @@ -735,7 +735,7 @@ def read_link_config(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def write_link_config(self): + async def write_link_config(self): """ Settings - write the configuration of a remote installation link --- @@ -796,7 +796,7 @@ def write_link_config(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def remove_link_config(self): + async def remove_link_config(self): """ Settings - remove a configuration for a remote installation link --- @@ -859,7 +859,7 @@ def remove_link_config(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def get_all_libraries(self): + async def get_all_libraries(self): """ Settings - get list of all libraries --- @@ -913,7 +913,7 @@ def get_all_libraries(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def read_library_config(self): + async def read_library_config(self): """ Settings - read the configuration of one library --- @@ -1008,7 +1008,7 @@ def read_library_config(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def write_library_config(self): + async def write_library_config(self): """ Settings - write the configuration of one library --- @@ -1074,7 +1074,7 @@ def write_library_config(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def remove_library(self): + async def remove_library(self): """ Settings - remove a library --- @@ -1139,7 +1139,7 @@ def remove_library(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def export_library_plugin_config(self): + async def export_library_plugin_config(self): """ Settings - export the plugin configuration of one library --- @@ -1203,7 +1203,7 @@ def export_library_plugin_config(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def import_library_plugin_config(self): + async def import_library_plugin_config(self): """ Settings - import the plugin configuration of one library --- diff --git a/unmanic/webserver/api_v2/upload_api.py b/unmanic/webserver/api_v2/upload_api.py index 1f26e2e2..e24dd272 100644 --- a/unmanic/webserver/api_v2/upload_api.py +++ b/unmanic/webserver/api_v2/upload_api.py @@ -139,7 +139,7 @@ def receiver(chunk): return receiver - def upload_file_to_pending_tasks(self): + async def upload_file_to_pending_tasks(self): """ Upload - upload a new pending task --- @@ -246,7 +246,7 @@ def upload_file_to_pending_tasks(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def upload_and_install_plugin(self): + async def upload_and_install_plugin(self): """ Upload - upload a plugin and install it --- diff --git a/unmanic/webserver/api_v2/version_api.py b/unmanic/webserver/api_v2/version_api.py index 284033d5..e7d85477 100644 --- a/unmanic/webserver/api_v2/version_api.py +++ b/unmanic/webserver/api_v2/version_api.py @@ -59,7 +59,7 @@ def initialize(self, **kwargs): self.unmanic_data_queues = udq.get_unmanic_data_queues() self.config = config.Config() - def get_unmanic_version(self): + async def get_unmanic_version(self): """ Version - read --- diff --git a/unmanic/webserver/api_v2/workers_api.py b/unmanic/webserver/api_v2/workers_api.py index 399591d7..1c85a072 100644 --- a/unmanic/webserver/api_v2/workers_api.py +++ b/unmanic/webserver/api_v2/workers_api.py @@ -87,7 +87,7 @@ def initialize(self, **kwargs): self.unmanic_data_queues = udq.get_unmanic_data_queues() self.foreman = urt.get_unmanic_running_thread('foreman') - def pause_worker(self): + async def pause_worker(self): """ Workers - Pause worker by ID --- @@ -148,7 +148,7 @@ def pause_worker(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def pause_all_workers(self): + async def pause_all_workers(self): """ Workers - Pause all workers --- @@ -200,7 +200,7 @@ def pause_all_workers(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def resume_worker(self): + async def resume_worker(self): """ Workers - Resume worker by ID --- @@ -261,7 +261,7 @@ def resume_worker(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def resume_all_workers(self): + async def resume_all_workers(self): """ Workers - Resume all workers --- @@ -313,7 +313,7 @@ def resume_all_workers(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def terminate_worker(self): + async def terminate_worker(self): """ Workers - Terminate worker by ID --- @@ -374,7 +374,7 @@ def terminate_worker(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def terminate_all_workers(self): + async def terminate_all_workers(self): """ Workers - Terminate all workers --- @@ -426,7 +426,7 @@ def terminate_all_workers(self): self.set_status(self.STATUS_ERROR_INTERNAL, reason=str(e)) self.write_error() - def workers_status(self): + async def workers_status(self): """ Workers - Return the status of all workers ---