From 2816a0880182fe71079ac7728628fbf7dc03e4b3 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Fri, 11 Jun 2021 09:35:37 +0200 Subject: [PATCH] Fix Tmdb, Menu contestuale, Autoplay --- core/tmdb.py | 5 +++-- platformcode/contextmenu/__init__.py | 1 + platformcode/platformtools.py | 10 ++++------ 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 platformcode/contextmenu/__init__.py diff --git a/core/tmdb.py b/core/tmdb.py index ee2133f3..452b4ccf 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -1537,12 +1537,13 @@ class Tmdb(object): return ret_dic def get_list_episodes(self): - url = '{}/tv/{}?api_key={}&language={}'.format(host=host, id=self.search_id, api=api, lang=self.search_language) + # from core.support import dbg;dbg() + url = '{}/tv/{}?api_key={}&language={}'.format(host, self.search_id, api, self.search_language) results = requests.get(url).json().get('seasons', []) seasons = [] if results and 'Error' not in results: for season in results: - url = '{host}/tv/{id}/season/{season}?api_key={api}&language={lang}'.format(host=host, id=self.search_id, season=season['season_number'], api=api, lang=self.search_language) + url = '{}/tv/{}/season/{}?api_key={}&language={}'.format(host, self.search_id, season['season_number'], api, self.search_language) try: start_from = requests.get(url).json()['episodes'][0]['episode_number'] except: start_from = 1 seasons.append({'season_number':season['season_number'], 'episode_count':season['episode_count'], 'start_from':start_from}) diff --git a/platformcode/contextmenu/__init__.py b/platformcode/contextmenu/__init__.py new file mode 100644 index 00000000..7c68785e --- /dev/null +++ b/platformcode/contextmenu/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- \ No newline at end of file diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 8c87fb38..b3d3d755 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -336,11 +336,8 @@ def render_items(itemlist, parent_item): if not item.title: item.title = '' # If there is no action or it is findvideos / play, folder = False because no listing will be returned - if item.folder == "": # not set - if item.action in ['play', '']: - item.folder = False - else: - item.folder = True + if item.action in ['play', '']: + item.folder = False if item.fanart == "": item.fanart = parent_item.fanart if item.action == 'play' and thumb_type == 1 and not item.forcethumb: @@ -361,7 +358,8 @@ def render_items(itemlist, parent_item): listitem.setArt({'icon': icon_image, 'thumb': item.thumbnail, 'poster': item.thumbnail, 'fanart': item.fanart if item.fanart else default_fanart}) - listitem.setProperty('IsPlayable', str(config.get_setting("player_mode") == 1 and item.action == "play" and not item.nfo).lower()) + if config.get_setting("player_mode") == 1 and item.action == "play" and not item.nfo: + listitem.setProperty('IsPlayable', 'true') set_infolabels(listitem, item)