From 9d7d0efde919caccbdf8fc0a9bd8338c79269a35 Mon Sep 17 00:00:00 2001 From: mac12m99 <10120390+mac12m99@users.noreply.github.com> Date: Thu, 10 Jun 2021 16:48:04 +0200 Subject: [PATCH] Contextmenu: rimuovi episodi locali ed elimina serie/canale --- platformcode/contextmenu/contextmenu.json | 2 +- .../{update_tv_show.py => tvshow_options.py} | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) rename platformcode/contextmenu/{update_tv_show.py => tvshow_options.py} (91%) diff --git a/platformcode/contextmenu/contextmenu.json b/platformcode/contextmenu/contextmenu.json index 0bd8617f..3acd6121 100644 --- a/platformcode/contextmenu/contextmenu.json +++ b/platformcode/contextmenu/contextmenu.json @@ -1,5 +1,5 @@ [ "platformcode.contextmenu.search", - "platformcode.contextmenu.update_tv_show", + "platformcode.contextmenu.tvshow_options", "platformcode.contextmenu.trailer" ] \ No newline at end of file diff --git a/platformcode/contextmenu/update_tv_show.py b/platformcode/contextmenu/tvshow_options.py similarity index 91% rename from platformcode/contextmenu/update_tv_show.py rename to platformcode/contextmenu/tvshow_options.py index 8c40e50e..fd501db8 100644 --- a/platformcode/contextmenu/update_tv_show.py +++ b/platformcode/contextmenu/tvshow_options.py @@ -148,7 +148,18 @@ def get_menu_items(): lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?{}&title={}&action=mark_tvshow_as_updatable&channel=videolibrary&active={})".format(item_url, update_text, str(value))))) if item.local_episodes_path == "": items.append((config.get_localized_string(80048), lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?{}&action=add_local_episodes&channel=videolibrary&path={})".format(item_url, path)))) + else: + items.append((config.get_localized_string(80049), lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?{}&action=remove_local_episodes&channel=videolibrary&path={})".format(item_url, path)))) + # Context menu: Delete series / channel + channels_num = len(item.library_urls) + if channels_num > 1: + delete_text = config.get_localized_string(60024) + multichannel = True + else: + delete_text = config.get_localized_string(60025) + multichannel = False + items.append((delete_text, lambda: xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?{}&action=delete&channel=videolibrary&multichannel={}&path={})".format(item_url, str(multichannel), path)))) # if config.get_setting('downloadenabled'): # from core import videolibrarytools # from core import filetools