Icone Genere in ricerca e migliorato autothumb

This commit is contained in:
Alhaziel
2019-11-16 14:59:03 +01:00
committed by marco
parent 3c4625e513
commit 703d2d0704
2 changed files with 7 additions and 6 deletions
+5 -5
View File
@@ -409,16 +409,16 @@ def thumb(itemlist=[], genre=False, thumb=''):
if genre == False: if genre == False:
for thumb, titles in icon_dict.items(): 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' thumb = 'search'
for suffix, titles in search_suffix.items(): 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 thumb = thumb + suffix
item.thumbnail = get_thumb(thumb + '.png') 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': if thumb == 'channels_movie' or thumb == 'channels_tvshow':
for suffix, titles in suffix_dict.items(): 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 thumb = thumb + suffix
item.thumbnail = get_thumb(thumb + '.png') item.thumbnail = get_thumb(thumb + '.png')
else: item.thumbnail = get_thumb(thumb + '.png') else: item.thumbnail = get_thumb(thumb + '.png')
@@ -427,7 +427,7 @@ def thumb(itemlist=[], genre=False, thumb=''):
else: else:
for thumb, titles in icon_dict.items(): 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') item.thumbnail = get_thumb(thumb + '.png')
else: else:
thumb = item.thumbnails thumb = item.thumbnails
+2 -1
View File
@@ -58,6 +58,7 @@ def mainlist(item):
def genres_menu(item): def genres_menu(item):
from channelselector import thumb
itemlist = [] itemlist = []
@@ -69,7 +70,7 @@ def genres_menu(item):
for key, value in genres[item.type].items(): for key, value in genres[item.type].items():
itemlist.append(item.clone(title=value, action='discover_list', search_type='discover', itemlist.append(item.clone(title=value, action='discover_list', search_type='discover',
list_type=key, page='1')) 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): def sub_menu(item):
logger.info() logger.info()