Fix adding of show title, season and episode number

This commit is contained in:
croneter 2019-03-21 20:06:52 +01:00
parent 9665f34ee6
commit 7cb6c75f3b
2 changed files with 9 additions and 2 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

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