Add tautulli_update_exe and tautulli_update_pkg notification parameters

This commit is contained in:
JonnyWong16 2021-03-13 13:10:38 -08:00
parent 5b38b919c4
commit b7d0a466e7
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 13 additions and 0 deletions

View file

@ -606,6 +606,8 @@ NOTIFICATION_PARAMETERS = [
'parameters': [ 'parameters': [
{'name': 'Tautulli Update Version', 'type': 'str', 'value': 'tautulli_update_version', 'description': 'The available update version for Tautulli.'}, {'name': 'Tautulli Update Version', 'type': 'str', 'value': 'tautulli_update_version', 'description': 'The available update version for Tautulli.'},
{'name': 'Tautulli Update Release URL', 'type': 'str', 'value': 'tautulli_update_release_url', 'description': 'The release page URL on GitHub.'}, {'name': 'Tautulli Update Release URL', 'type': 'str', 'value': 'tautulli_update_release_url', 'description': 'The release page URL on GitHub.'},
{'name': 'Tautulli Update Exe', 'type': 'str', 'value': 'tautulli_update_exe', 'description': 'The Windows exe download URL for the available update.'},
{'name': 'Tautulli Update Pkg', 'type': 'str', 'value': 'tautulli_update_pkg', 'description': 'The MacOS pkg download URL for the available update.'},
{'name': 'Tautulli Update Tar', 'type': 'str', 'value': 'tautulli_update_tar', 'description': 'The tar download URL for the available update.'}, {'name': 'Tautulli Update Tar', 'type': 'str', 'value': 'tautulli_update_tar', 'description': 'The tar download URL for the available update.'},
{'name': 'Tautulli Update Zip', 'type': 'str', 'value': 'tautulli_update_zip', 'description': 'The zip download URL for the available update.'}, {'name': 'Tautulli Update Zip', 'type': 'str', 'value': 'tautulli_update_zip', 'description': 'The zip download URL for the available update.'},
{'name': 'Tautulli Update Commit', 'type': 'str', 'value': 'tautulli_update_commit', 'description': 'The commit hash for the available update.'}, {'name': 'Tautulli Update Commit', 'type': 'str', 'value': 'tautulli_update_commit', 'description': 'The commit hash for the available update.'},

View file

@ -1109,6 +1109,15 @@ def build_server_notify_params(notify_action=None, **kwargs):
plexpy_download_info = defaultdict(str, kwargs.pop('plexpy_download_info', {})) plexpy_download_info = defaultdict(str, kwargs.pop('plexpy_download_info', {}))
remote_access_info = defaultdict(str, kwargs.pop('remote_access_info', {})) remote_access_info = defaultdict(str, kwargs.pop('remote_access_info', {}))
windows_exe = macos_pkg = ''
if plexpy_download_info:
release_assets = plexpy_download_info.get('assets', [])
for asset in release_assets:
if asset['content_type'] == 'application/vnd.microsoft.portable-executable':
windows_exe = asset['browser_download_url']
elif asset['content_type'] == 'application/vnd.apple.installer+xml':
macos_pkg = asset['browser_download_url']
now = arrow.now() now = arrow.now()
now_iso = now.isocalendar() now_iso = now.isocalendar()
@ -1163,6 +1172,8 @@ def build_server_notify_params(notify_action=None, **kwargs):
# Tautulli update parameters # Tautulli update parameters
'tautulli_update_version': plexpy_download_info['tag_name'], 'tautulli_update_version': plexpy_download_info['tag_name'],
'tautulli_update_release_url': plexpy_download_info['html_url'], 'tautulli_update_release_url': plexpy_download_info['html_url'],
'tautulli_update_exe': windows_exe,
'tautulli_update_pkg': macos_pkg,
'tautulli_update_tar': plexpy_download_info['tarball_url'], 'tautulli_update_tar': plexpy_download_info['tarball_url'],
'tautulli_update_zip': plexpy_download_info['zipball_url'], 'tautulli_update_zip': plexpy_download_info['zipball_url'],
'tautulli_update_commit': kwargs.pop('plexpy_update_commit', ''), 'tautulli_update_commit': kwargs.pop('plexpy_update_commit', ''),