Add return ID for async API calls

* export_id, notification_id, and newsletter_notification_d
This commit is contained in:
JonnyWong16 2023-05-05 15:56:32 -07:00
parent fe4fba353e
commit 3a1d6322ae
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
4 changed files with 15 additions and 15 deletions

View file

@ -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. """