From eafae197a22f1e07206f9581e0daceb25886ee98 Mon Sep 17 00:00:00 2001 From: fatshotty Date: Tue, 20 Apr 2021 10:57:39 +0200 Subject: [PATCH] fix menu visibility --- addon.xml | 4 ++-- externalsearch.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/addon.xml b/addon.xml index 445be873..94322fde 100644 --- a/addon.xml +++ b/addon.xml @@ -14,11 +14,11 @@ - String.StartsWith(Container.FolderPath, 'plugin://plugin.video.kod/') + String.IsEqual(ListItem.dbtype,tvshow) + String.StartsWith(ListItem.FileNameAndPath, 'plugin://plugin.video.kod/') + String.IsEqual(ListItem.dbtype,tvshow) - !String.StartsWith(Container.FolderPath, 'plugin://plugin.video.kod/') + String.IsEqual(ListItem.dbtype,tvshow) | String.IsEqual(ListItem.dbtype,movie) + !String.StartsWith(ListItem.FileNameAndPath, 'plugin://plugin.video.kod/') + [String.IsEqual(ListItem.dbtype,tvshow) | String.IsEqual(ListItem.dbtype,movie)] diff --git a/externalsearch.py b/externalsearch.py index be94e640..52635f18 100644 --- a/externalsearch.py +++ b/externalsearch.py @@ -29,6 +29,18 @@ def execute_search(): title = xbmc.getInfoLabel('ListItem.Title') year = xbmc.getInfoLabel('ListItem.Year') imdb = xbmc.getInfoLabel('ListItem.IMDBNumber') + # folderPath = xbmc.getInfoLabel('Container.FolderPath') + # filePath = xbmc.getInfoLabel('ListItem.FileNameAndPath') + + + # logger.info("****") + # logger.info( xbmc.getCondVisibility("String.Contains(Container.FolderPath, 'plugin.video.kod')") ) + # logger.info( xbmc.getCondVisibility("String.Contains(ListItem.FileNameAndPath, 'plugin.video.kod')") ) + # logger.info( xbmc.getCondVisibility("String.IsEqual(ListItem.dbtype,tvshow)") ) + # logger.info( xbmc.getCondVisibility("String.IsEqual(ListItem.dbtype,movie)") ) + # logger.info("****") + + # visible = xbmc.getCondVisibility("!String.StartsWith(ListItem.FileNameAndPath, 'plugin://plugin.video.kod/') + [String.IsEqual(ListItem.dbtype,tvshow) | String.IsEqual(ListItem.dbtype,movie)]") logstr = "Selected ListItem is: 'IMDB: {}' - TMDB: {}' - 'Title: {}' - 'Year: {}'' - 'Type: {}'".format(imdb, tmdbid, title, year, mediatype) logger.info(logstr)