From 5a14b5bc351815ca44a86653dc3e2285e77ff9b7 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Thu, 15 Oct 2020 11:16:15 -0700 Subject: [PATCH] Add all Plex server and Tautulli info to register device response --- plexpy/__init__.py | 16 ++++++++++++++++ plexpy/api2.py | 13 ++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/plexpy/__init__.py b/plexpy/__init__.py index a7e4a252..cae59fd7 100644 --- a/plexpy/__init__.py +++ b/plexpy/__init__.py @@ -2401,3 +2401,19 @@ def check_folder_writable(folder, fallback, name): return folder, False return folder, True + + +def get_tautulli_info(): + tautulli = { + 'tautulli_install_type': INSTALL_TYPE, + 'tautulli_version': common.RELEASE, + 'tautulli_branch': CONFIG.GIT_BRANCH, + 'tautulli_commit': CURRENT_VERSION, + 'tautulli_platform':common.PLATFORM, + 'tautulli_platform_release': common.PLATFORM_RELEASE, + 'tautulli_platform_version': common.PLATFORM_VERSION, + 'tautulli_platform_linux_distro': common.PLATFORM_LINUX_DISTRO, + 'tautulli_platform_device_name': common.PLATFORM_DEVICE_NAME, + 'tautulli_python_version': common.PYTHON_VERSION, + } + return tautulli diff --git a/plexpy/api2.py b/plexpy/api2.py index 446f2680..1ab1f0af 100644 --- a/plexpy/api2.py +++ b/plexpy/api2.py @@ -48,6 +48,7 @@ if plexpy.PYTHON2: import notifiers import newsletter_handler import newsletters + import plextv import users else: from plexpy import common @@ -61,6 +62,7 @@ else: from plexpy import notifiers from plexpy import newsletter_handler from plexpy import newsletters + from plexpy import plextv from plexpy import users @@ -450,11 +452,12 @@ class API2(object): mobile_app.set_temp_device_token(True) - data = { - "pms_name": plexpy.CONFIG.PMS_NAME, - "server_id": plexpy.CONFIG.PMS_UUID, - "tautulli_version": common.RELEASE - } + plex_server = plextv.get_server_resources(return_info=True) + tautulli = plexpy.get_tautulli_info() + + data = {"server_id": plexpy.CONFIG.PMS_UUID} + data.update(plex_server) + data.update(tautulli) return data