Proxy PMS downloads json through server

This commit is contained in:
JonnyWong16 2022-01-05 14:00:13 -08:00
commit b7937b8740
No known key found for this signature in database
GPG key ID: 7A649674469E6574
4 changed files with 27 additions and 23 deletions

View file

@ -754,7 +754,16 @@ class PlexTV(object):
return clean_servers
def get_plex_downloads(self):
def get_plex_downloads(self, update_channel):
plex_downloads = self.get_plextv_downloads(plexpass=(update_channel == 'beta'))
try:
return json.loads(plex_downloads)
except Exception as e:
logger.warn("Tautulli PlexTV :: Unable to load JSON for get_plex_updates: %s", e)
return {}
def get_plex_update(self):
logger.debug("Tautulli PlexTV :: Retrieving current server version.")
pms_connect = pmsconnect.PmsConnect()
@ -763,12 +772,9 @@ class PlexTV(object):
update_channel = pms_connect.get_server_update_channel()
logger.debug("Tautulli PlexTV :: Plex update channel is %s." % update_channel)
plex_downloads = self.get_plextv_downloads(plexpass=(update_channel == 'beta'))
available_downloads = self.get_plex_downloads(update_channel=update_channel)
try:
available_downloads = json.loads(plex_downloads)
except Exception as e:
logger.warn("Tautulli PlexTV :: Unable to load JSON for get_plex_updates.")
if not available_downloads:
return {}
# Get the updates for the platform