Merge pull request #782 from croneter/fix-nodes

Fix widgets not working in some cases, e.g. Nvidia Shield
This commit is contained in:
croneter 2019-03-21 20:34:44 +01:00 committed by GitHub
commit afc15af9cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -174,6 +174,12 @@ def show_listing(xml, plex_type=None, section_id=None, synched=True, key=None,
# Initialization
widgets.PLEX_TYPE = plex_type
widgets.SYNCHED = synched
if plex_type == v.PLEX_TYPE_SHOW and key and 'onDeck' in key:
widgets.APPEND_SHOW_TITLE = utils.settings('OnDeckTvAppendShow') == 'true'
widgets.APPEND_SXXEXX = utils.settings('OnDeckTvAppendSeason') == 'true'
if plex_type == v.PLEX_TYPE_SHOW and key and 'recentlyAdded' in key:
widgets.APPEND_SHOW_TITLE = utils.settings('RecentTvAppendShow') == 'true'
widgets.APPEND_SXXEXX = utils.settings('RecentTvAppendSeason') == 'true'
if content_type and xml[0].tag == 'Playlist':
# Certain views mix playlist types audio and video
for entry in reversed(xml):

View file

@ -51,7 +51,7 @@ def process_method_on_list(method_to_run, items):
pool.close()
pool.join()
else:
all_items = [method_to_run(items) for item in items]
all_items = [method_to_run(item) for item in items]
all_items = filter(None, all_items)
return all_items
@ -210,9 +210,10 @@ def _generate_content(xml_element):
# Prefix to the episode's title/label
if season_no is not None and episode_no is not None:
if APPEND_SXXEXX is True:
item['label'] = "S%.2dE%.2d - %s" % (season_no, episode_no, item['label'])
item['title'] = "S%.2dE%.2d - %s" % (season_no, episode_no, item['title'])
if APPEND_SHOW_TITLE is True:
item['label'] = "%s - %s " % (tvshowtitle, item['label'])
item['title'] = "%s - %s " % (tvshowtitle, item['title'])
item['label'] = item['title']
# Determine the path for this item
key = api.path_and_plex_id()