mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 17:52:59 -07:00
Add return ID for async API calls
* export_id, notification_id, and newsletter_notification_d
This commit is contained in:
parent
fe4fba353e
commit
3a1d6322ae
4 changed files with 15 additions and 15 deletions
|
@ -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. """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue