From 703d2d0704efd06bf27812b2f7a35fc113b15ae2 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Sat, 16 Nov 2019 14:59:03 +0100 Subject: [PATCH] Icone Genere in ricerca e migliorato autothumb --- channelselector.py | 10 +++++----- specials/search.py | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/channelselector.py b/channelselector.py index 79faac14..5177e3c8 100644 --- a/channelselector.py +++ b/channelselector.py @@ -409,16 +409,16 @@ def thumb(itemlist=[], genre=False, thumb=''): if genre == False: for thumb, titles in icon_dict.items(): - if any( word in item.title.lower() for word in search): + if any( word in item.title.lower().split() for word in search): thumb = 'search' for suffix, titles in search_suffix.items(): - if any( word in item.title.lower() for word in titles ): + if any( word in item.title.lower().split() for word in titles ): thumb = thumb + suffix item.thumbnail = get_thumb(thumb + '.png') - elif any( word in item.title.lower() for word in titles ): + elif any( word in item.title.lower().split() for word in titles ): if thumb == 'channels_movie' or thumb == 'channels_tvshow': for suffix, titles in suffix_dict.items(): - if any( word in item.title.lower() for word in titles ): + if any( word in item.title.lower().split() for word in titles ): thumb = thumb + suffix item.thumbnail = get_thumb(thumb + '.png') else: item.thumbnail = get_thumb(thumb + '.png') @@ -427,7 +427,7 @@ def thumb(itemlist=[], genre=False, thumb=''): else: for thumb, titles in icon_dict.items(): - if any(word in item.title.lower() for word in titles ): + if any(word in item.title.lower().split() for word in titles ): item.thumbnail = get_thumb(thumb + '.png') else: thumb = item.thumbnails diff --git a/specials/search.py b/specials/search.py index 196614f4..006cab49 100644 --- a/specials/search.py +++ b/specials/search.py @@ -58,6 +58,7 @@ def mainlist(item): def genres_menu(item): + from channelselector import thumb itemlist = [] @@ -69,7 +70,7 @@ def genres_menu(item): for key, value in genres[item.type].items(): itemlist.append(item.clone(title=value, action='discover_list', search_type='discover', list_type=key, page='1')) - return sorted(itemlist, key=lambda it: it.title) + return thumb(sorted(itemlist, key=lambda it: it.title), genre=True) def sub_menu(item): logger.info()