Skip to content

Commit

Permalink
use Kodi's default episode naming like '1x09. episode'
Browse files Browse the repository at this point in the history
  • Loading branch information
sualfred committed May 5, 2020
1 parent 08537a9 commit 7b41716
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion resources/lib/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 7b41716

Please sign in to comment.