- for index in seasons_sorted:
- for season_id in season_list:
- season = season_list[season_id]
- if int(season['idx']) == index:
- li = xbmcgui.ListItem(label=season['text'])
- # add some art to the item
- li = self._generate_art_info(entry=season, li=li)
- # add list item info
- li = self._generate_entry_info(entry=season, li=li, base_info={'mediatype': 'season'})
- li = self._generate_context_menu_items(entry=season, li=li)
- url = build_url({'action': 'episode_list', 'season_id': season_id})
- xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=True)
+ for season in seasons_sorted:
+ li = xbmcgui.ListItem(label=season['text'])
+ # add some art to the item
+ li = self._generate_art_info(entry=season, li=li)
+ # add list item info
+ li, infos = self._generate_entry_info(entry=season, li=li, base_info={'mediatype': 'season'})
+ li = self._generate_context_menu_items(entry=season, li=li)
+ params = {'action': 'episode_list', 'season_id': season['id']}
+ if 'tvshowtitle' in infos:
+ params['tvshowtitle'] = infos.get('tvshowtitle', '').encode('utf-8')
+ url = build_url(params)
+ xbmcplugin.addDirectoryItem(handle=self.plugin_handle, url=url, listitem=li, isFolder=True)