diff --git a/plexpy/api2.py b/plexpy/api2.py index 4d9efbdc..eefaa9fd 100644 --- a/plexpy/api2.py +++ b/plexpy/api2.py @@ -505,7 +505,8 @@ class API2(object): script_args (str): The arguments for script notifications Returns: - None + json: + {"notification_id": 1} ``` """ if not notifier_id: @@ -527,14 +528,14 @@ class API2(object): body=body, **kwargs) - if success: + if isinstance(success, int): self._api_msg = 'Notification sent.' self._api_result_type = 'success' + return {'notification_id': success} else: self._api_msg = 'Notification failed.' self._api_result_type = 'error' - - return + return def notify_newsletter(self, newsletter_id='', subject='', body='', message='', **kwargs): """ Send a newsletter using Tautulli. @@ -549,7 +550,8 @@ class API2(object): message (str): The message of the newsletter Returns: - None + json: + {"newsletter_notification_id": 1} ``` """ if not newsletter_id: @@ -572,14 +574,14 @@ class API2(object): message=message, **kwargs) - if success: + if isinstance(success, int): self._api_msg = 'Newsletter sent.' self._api_result_type = 'success' + return {'newsletter_notification_id': success} else: self._api_msg = 'Newsletter failed.' self._api_result_type = 'error' - - return + return def _api_make_md(self): """ Tries to make a API.md to simplify the api docs. """ diff --git a/plexpy/exporter.py b/plexpy/exporter.py index 9bcb5d06..908aced7 100644 --- a/plexpy/exporter.py +++ b/plexpy/exporter.py @@ -1837,7 +1837,7 @@ class Export(object): threading.Thread(target=self._real_export).start() - return True + return self.export_id def add_export(self): keys = { diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index bc8d39c5..2171d2bd 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -438,7 +438,7 @@ def notify(notifier_id=None, notify_action=None, stream_data=None, timeline_data if success: set_notify_success(notification_id) - return True + return notification_id def get_notify_state(session): diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 57921b61..88b65174 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -7057,9 +7057,7 @@ class WebInterface(object): Returns: json: - {"result": "success", - "message": "Metadata export has started." - } + {"export_id": 1} ``` """ individual_files = helpers.bool_true(individual_files) @@ -7075,8 +7073,8 @@ class WebInterface(object): export_type=export_type, individual_files=individual_files).export() - if result is True: - return {'result': 'success', 'message': 'Metadata export has started.'} + if isinstance(result, int): + return {'result': 'success', 'message': 'Metadata export has started.', 'export_id': result} else: return {'result': 'error', 'message': result}