Customize number of items fetched from PMS

- Fixes #186
- Fixes #182
- Now defaults to 25 instead of 100
This commit is contained in:
tomkat83 2017-01-20 14:41:28 +01:00
parent 8f73d40018
commit 627c010fb9
6 changed files with 11 additions and 2 deletions

View file

@ -437,6 +437,7 @@
<string id="39074">TV Shows</string>
<string id="39075">Always use default Plex subtitle if possible</string>
<string id="39076">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</string>
<string id="39077">Number of PMS items to show in widgets (e.g. "On Deck")</string>
<!-- Plex Entrypoint.py -->
<string id="39200">Log-out Plex Home User </string>

View file

@ -386,6 +386,7 @@
<string id="39074">TV Serien</string>
<string id="39075">Falls möglich, Plex Standard-Untertitel anzeigen</string>
<string id="39076">Falls du mehrere Plex Bibliotheken einer Art nutzt, z.B. "Filme Kinder" und "Filme Eltern", lies unbedingt das Wiki unter https://goo.gl/JFtQV9</string>
<string id="39077">Anzahl anzuzeigender PMS Einträge in Widgets (z.B. "Aktuell")</string>
<!-- Plex Entrypoint.py -->
<string id="39200">Plex Home Benutzer abmelden: </string>

View file

@ -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):

View file

@ -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',

View file

@ -130,6 +130,7 @@
-->
<category label="39073"><!-- Appearance Tweaks -->
<setting id="fetch_pms_item_number" label="39077" type="number" default="25" option="int" />
<setting type="lsep" label="39074" /><!-- TV Shows -->
<setting id="OnDeckTVextended" type="bool" label="39058" default="true" /><!-- Extend Plex TV Series "On Deck" view to all shows -->
<setting id="OnDeckTvAppendShow" type="bool" label="39047" default="false" /><!--On Deck view: Append show title to episode-->

View file

@ -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)