From 1827f2506c49179deedd18b3b618bad200c507e8 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sun, 5 Feb 2017 16:11:31 +0100 Subject: [PATCH] Fix some possible connection issues --- resources/lib/PlexAPI.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index d1e26558..6a62f5be 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -474,9 +474,18 @@ class PlexAPI(): if PMS['uuid'] in self.g_PMS: log.debug('We already know of PMS %s from plex.tv' % PMS['serverName']) - continue - self.declarePMS(PMS['uuid'], PMS['serverName'], 'http', - PMS['ip'], PMS['port']) + # Update with GDM data - potentially more reliable than plex.tv + self.updatePMSProperty(PMS['uuid'], 'ip', PMS['ip']) + self.updatePMSProperty(PMS['uuid'], 'port', PMS['port']) + self.updatePMSProperty(PMS['uuid'], 'local', '1') + self.updatePMSProperty(PMS['uuid'], 'scheme', 'http') + self.updatePMSProperty(PMS['uuid'], + 'baseURL', + 'http://%s:%s' % (PMS['ip'], + PMS['port'])) + else: + self.declarePMS(PMS['uuid'], PMS['serverName'], 'http', + PMS['ip'], PMS['port']) # Ping to check whether we need HTTPs or HTTP https = PMSHttpsEnabled('%s:%s' % (PMS['ip'], PMS['port'])) if https is None: