def episodes(series_id, season): xbmcplugin.setContent(plugin_handle, 'episodes') content = get.series_info(series_id) content = json.loads(content)['video']['seasons'] for test in content: episode_season = unicode(test['seq']) if episode_season == season: for item in test['episodes']: episode_id = item['episodeId'] episode_nr = item['seq'] episode_title = (unicode(episode_nr) + '. ' + item['title']) duration = item['runtime'] offset = item['bookmark']['offset'] playcount = 0 if (duration > 0 and float(offset) / float(duration)) >= 0.9: playcount = 1 description = item['synopsis'] try: thumb = item['stills'][0]['url'] except: thumb = utility.addon_fanart() add.episode(episode_title, episode_id, 'play_video_main', thumb, description, duration, season, episode_nr, series_id, playcount) if utility.get_setting('force_view'): xbmc.executebuiltin('Container.SetViewMode(' + utility.get_setting('view_id_episodes') + ')') xbmcplugin.endOfDirectory(plugin_handle)
def episodes(series_id, season): xbmcplugin.setContent(plugin_handle, 'episodes') content = get.series_info(series_id) content = json.loads(content)['video']['seasons'] for test in content: episode_season = unicode(test['seq']) if episode_season == season: for item in test['episodes']: playcount = 0 episode_id = item['episodeId'] episode_nr = item['seq'] episode_title = (unicode(episode_nr) + '. ' + item['title']) duration = item['runtime'] offset = item['bookmark']['offset'] if (duration > 0 and float(offset) / float(duration)) >= 0.9: playcount = 1 description = item['synopsis'] try: thumb = item['stills'][0]['url'] except: thumb = utility.addon_fanart() add.episode(episode_title, episode_id, 'play_video_main', thumb, description, duration, season, episode_nr, series_id, playcount) if utility.get_setting('force_view'): xbmc.executebuiltin('Container.SetViewMode(' + utility.get_setting('view_id_episodes') + ')') xbmcplugin.endOfDirectory(plugin_handle)
def episodes(series_id, season): xbmcplugin.setContent(plugin_handle, 'episodes') episodes = get.episodes_data(season, series_id) for episode in episodes: add.episode(episode) if generic_utility.get_setting('force_view'): xbmc.executebuiltin('Container.SetViewMode(' + generic_utility.get_setting('view_id_episodes') + ')') xbmcplugin.addSortMethod(plugin_handle, xbmcplugin.SORT_METHOD_EPISODE) xbmcplugin.endOfDirectory(plugin_handle)
def episodes(series_id, season): xbmcplugin.setContent(plugin_handle, 'episodes') episodes = get.episodes_data(season, series_id) for episode in episodes: add.episode(episode) if generic_utility.get_setting('force_view'): xbmc.executebuiltin('Container.SetViewMode(' + generic_utility.get_setting('view_id_episodes') + ')') xbmcplugin.endOfDirectory(plugin_handle)