From 627c010fb9a1b4325bd97a2540e1edf50e78985a Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Fri, 20 Jan 2017 14:41:28 +0100 Subject: [PATCH] Customize number of items fetched from PMS - Fixes #186 - Fixes #182 - Now defaults to 25 instead of 100 --- resources/language/English/strings.xml | 1 + resources/language/German/strings.xml | 1 + resources/lib/kodimonitor.py | 6 +++++- resources/lib/videonodes.py | 2 +- resources/settings.xml | 1 + service.py | 2 ++ 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index e592d5ea..2445a32b 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -437,6 +437,7 @@ TV Shows Always use default Plex subtitle if possible If you use several Plex libraries of one kind, e.g. "Kids Movies" and "Parents Movies", be sure to check the Wiki: https://goo.gl/JFtQV9 + Number of PMS items to show in widgets (e.g. "On Deck") Log-out Plex Home User diff --git a/resources/language/German/strings.xml b/resources/language/German/strings.xml index c3711496..81bc6fea 100644 --- a/resources/language/German/strings.xml +++ b/resources/language/German/strings.xml @@ -386,6 +386,7 @@ TV Serien Falls möglich, Plex Standard-Untertitel anzeigen Falls du mehrere Plex Bibliotheken einer Art nutzt, z.B. "Filme Kinder" und "Filme Eltern", lies unbedingt das Wiki unter https://goo.gl/JFtQV9 + Anzahl anzuzeigender PMS Einträge in Widgets (z.B. "Aktuell") Plex Home Benutzer abmelden: diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 0232a28a..4554bb47 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -53,7 +53,8 @@ class KodiMonitor(Monitor): 'dbSyncIndicator': 'dbSyncIndicator', 'remapSMB': 'remapSMB', 'replaceSMB': 'replaceSMB', - 'force_transcode_pix': 'plex_force_transcode_pix' + 'force_transcode_pix': 'plex_force_transcode_pix', + 'fetch_pms_item_number': 'fetch_pms_item_number' } # Path replacement for typus in REMAP_TYPE_FROM_PLEXTYPE.values(): @@ -66,6 +67,9 @@ class KodiMonitor(Monitor): log.debug('PKC settings changed: %s is now %s' % (settings_value, settings(settings_value))) window(window_value, value=settings(settings_value)) + if settings_value == 'fetch_pms_item_number': + log.info('Requesting playlist/nodes refresh') + window('plex_runLibScan', value="views") @CatchExceptions(warnuser=False) def onNotification(self, sender, method, data): diff --git a/resources/lib/videonodes.py b/resources/lib/videonodes.py index 0aed244e..328ca868 100644 --- a/resources/lib/videonodes.py +++ b/resources/lib/videonodes.py @@ -45,7 +45,7 @@ class VideoNodes(object): def viewNode(self, indexnumber, tagname, mediatype, viewtype, viewid, delete=False): # Plex: reassign mediatype due to Kodi inner workings # How many items do we get at most? - limit = "100" + limit = window('fetch_pms_item_number') mediatypes = { 'movie': 'movies', 'show': 'tvshows', diff --git a/resources/settings.xml b/resources/settings.xml index 6b2008fa..fd16f3fa 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -130,6 +130,7 @@ --> + diff --git a/service.py b/service.py index 557d032a..3515919e 100644 --- a/service.py +++ b/service.py @@ -88,6 +88,8 @@ class Service(): value=xbmc.translatePath("special://profile")) window('plex_context', value='true' if settings('enableContext') == "true" else "") + window('fetch_pms_item_number', + value=settings('fetch_pms_item_number')) # Initial logging log.warn("======== START %s ========" % addonName)