From 43b385d24da2dd952a574b228bf03240e47bc6c3 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Wed, 9 Jun 2021 21:08:54 +0200 Subject: [PATCH] Contextmenu: gestione aggiornamento ed episodi locali --- platformcode/contextmenu/update_tv_show.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/platformcode/contextmenu/update_tv_show.py b/platformcode/contextmenu/update_tv_show.py index fd507aef..04a6835c 100644 --- a/platformcode/contextmenu/update_tv_show.py +++ b/platformcode/contextmenu/update_tv_show.py @@ -131,6 +131,27 @@ def get_menu_items(): logger.debug('get menu item') if check_condition(): items = [(config.get_localized_string(70269), update)] + from core import videolibrarytools + nfo = path + 'tvshow.nfo' + item = videolibrarytools.read_nfo(nfo)[1] + if item: + item.nfo = nfo + item_url = item.tourl() + # Context menu: Automatically search for new episodes or not + if item.active and int(item.active) > 0: + update_text = config.get_localized_string(60022) + value = 0 + else: + update_text = config.get_localized_string(60023) + value = 1 + items.append((update_text, + lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?%s&%s)" % (item_url, + "title=" + update_text + "&action=mark_tvshow_as_updatable&channel=videolibrary&active=" + str(value))))) + if item.local_episodes_path == "": + items.append((config.get_localized_string(80048), + lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?%s&%s)" % + (item_url, "action=add_local_episodes&channel=videolibrary")))) + # if config.get_setting('downloadenabled'): # from core import videolibrarytools # from core import filetools