From c5b76d1a3825811ce1043f4a7321626e6af1cf02 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Fri, 15 Apr 2016 09:44:42 +0200 Subject: [PATCH] New setting: I own this PMS - Needed if someone enters PMS IP manually, would not catch this info otherwise - Background: needed to choose correct background sync procedure --- resources/language/English/strings.xml | 1 + resources/language/German/strings.xml | 1 + resources/lib/initialsetup.py | 4 +++- resources/lib/librarysync.py | 4 ++-- resources/settings.xml | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index ec498e9b..ad91dfff 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -20,6 +20,7 @@ Username Port Number + I own this Plex Media Server Number of recent Movies to show: Number of recent TV episodes to show: Number of recent Music Albums to show: diff --git a/resources/language/German/strings.xml b/resources/language/German/strings.xml index e99b8202..7a2ae659 100644 --- a/resources/language/German/strings.xml +++ b/resources/language/German/strings.xml @@ -41,6 +41,7 @@ Benutze 'SIMPLEJSON' anstelle von 'JSON' Portnummer: + Dieser Plex Media Server gehört mir Anzahl der zuletzt hinzugefügten Filme: Anzahl der zuletzt hinzugefügten Episoden: Anzahl der zuletzt hinzugefügten Alben: diff --git a/resources/lib/initialsetup.py b/resources/lib/initialsetup.py index a3ab166d..a7e69597 100644 --- a/resources/lib/initialsetup.py +++ b/resources/lib/initialsetup.py @@ -217,7 +217,9 @@ class InitialSetup(): # Write to Kodi settings file utils.settings('plex_machineIdentifier', activeServer) utils.settings('plex_servername', server['name']) - utils.settings('plex_serverowned', server['owned']) + utils.settings('plex_serverowned', + 'true' if server['owned'] == '1' + else 'false') if server['local'] == '1': scheme = server['scheme'] utils.settings('ipaddress', server['ip']) diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 7cf84a1e..96c44f53 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -1453,7 +1453,7 @@ class LibrarySync(Thread): sessionKey = item.get('sessionKey') # Do we already have a sessionKey stored? if sessionKey not in self.sessionKeys: - if utils.window('plex_serverowned') == '0': + if utils.window('plex_serverowned') == 'false': # Not our PMS, we are not authorized to get the # sessions # On the bright side, it must be us playing :-) @@ -1472,7 +1472,7 @@ class LibrarySync(Thread): continue currSess = self.sessionKeys[sessionKey] - if utils.window('plex_serverowned') != '0': + if utils.window('plex_serverowned') != 'false': # Identify the user - same one as signed on with PKC? Skip # update if neither session's username nor userid match # (Owner sometime's returns id '1', not always) diff --git a/resources/settings.xml b/resources/settings.xml index c578e3c8..6d8d18ff 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -5,6 +5,7 @@ +