From 7b4171612326269f2f22f2206990e641f93b5ad6 Mon Sep 17 00:00:00 2001 From: Sebastian S Date: Tue, 5 May 2020 21:04:21 +0200 Subject: [PATCH] use Kodi's default episode naming like '1x09. episode' --- resources/lib/library.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/lib/library.py b/resources/lib/library.py index 8fd3fd1..7fe8c74 100644 --- a/resources/lib/library.py +++ b/resources/lib/library.py @@ -217,7 +217,17 @@ def handle_episodes(li,item): director = item.get('director', '') writer = item.get('writer', '') - li_item = xbmcgui.ListItem(item['title']) + if item['episode'] < 10: + label = '0%s. %s' % (item['episode'], item['title']) + else: + label = '%s. %s' % (item['episode'], item['title']) + + if item['season'] == '0': + label = 'S' + label + else: + label = '%sx%s' % (item['season'], label) + + li_item = xbmcgui.ListItem(label) li_item.setInfo(type='Video', infoLabels={'title': item['title'], 'episode': item['episode'], 'season': item['season'],