Fix Support Menu e Thumb per i menu
This commit is contained in:
@@ -333,10 +333,10 @@ def auto_filter(auto_lang=False):
|
||||
return lang
|
||||
|
||||
|
||||
def thumb(itemlist=[]):
|
||||
def thumb(itemlist=[], genre=False):
|
||||
if itemlist:
|
||||
import re
|
||||
|
||||
|
||||
icon_dict = {'channels_movie':['film'],
|
||||
'channels_tvshow':['serie','tv','episodi','episodio'],
|
||||
'channels_documentary':['documentari','documentario'],
|
||||
@@ -344,9 +344,9 @@ def thumb(itemlist=[]):
|
||||
'news':['novità', "novita'", 'aggiornamenti'],
|
||||
'now_playing':['cinema', 'in sala'],
|
||||
'channels_anime':['anime'],
|
||||
'genres':['genere', 'generi', 'categorie', 'categoria'],
|
||||
'channels_animation': ['animazione', 'cartoni', 'cartoon'],
|
||||
'genres':['genere', 'generi', 'categorie', 'categoria'],
|
||||
'channels_action':['azione', 'arti marziali'],
|
||||
'channels_animation': ['animazione', 'cartoni', 'cartoon'],
|
||||
'channels_adventure': ['avventura'],
|
||||
'channels_biographical':['biografico'],
|
||||
'channels_comedy':['comico','commedia', 'demenziale'],
|
||||
@@ -377,40 +377,44 @@ def thumb(itemlist=[]):
|
||||
suffix_dict = {'_hd':['hd','altadefinizione','alta definizione'],
|
||||
'_4k':['4K'],
|
||||
'_az':['lettera','lista','alfabetico','a-z'],
|
||||
'_year':['anno'],
|
||||
'_year':['anno', 'anni'],
|
||||
'_genre':['genere', 'generi', 'categorie', 'categoria']}
|
||||
|
||||
search = ['cerca']
|
||||
|
||||
search_suffix ={'_movie':['film'],
|
||||
'_tvshow':['serie','tv']}
|
||||
|
||||
for item in itemlist:
|
||||
|
||||
# Check if item has args propriety
|
||||
if item.args: item.title = item.title + ' || ' + str(item.args)
|
||||
if genre == False:
|
||||
|
||||
for thumb, titles in icon_dict.items():
|
||||
if any( word in item.title.lower() for word in search):
|
||||
thumb = 'search'
|
||||
for suffix, titles in search_suffix.items():
|
||||
if any( word in item.title.lower() for word in titles ):
|
||||
thumb = thumb + suffix
|
||||
item.thumbnail = get_thumb(thumb + '.png')
|
||||
elif any( word in item.title.lower() 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 ):
|
||||
for thumb, titles in icon_dict.items():
|
||||
if any( word in item.title.lower() for word in search):
|
||||
thumb = 'search'
|
||||
for suffix, titles in search_suffix.items():
|
||||
if any( word in item.title.lower() for word in titles ):
|
||||
thumb = thumb + suffix
|
||||
else:
|
||||
item.thumbnail = get_thumb(thumb + '.png')
|
||||
else:
|
||||
thumb = item.thumbnails
|
||||
elif any( word in item.title.lower() 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 ):
|
||||
thumb = thumb + suffix
|
||||
item.thumbnail = get_thumb(thumb + '.png')
|
||||
else: item.thumbnail = get_thumb(thumb + '.png')
|
||||
else:
|
||||
thumb = item.thumbnails
|
||||
|
||||
if item.thumbnail != '':
|
||||
break
|
||||
else:
|
||||
for thumb, titles in icon_dict.items():
|
||||
if any(word in item.title.lower() for word in titles ):
|
||||
item.thumbnail = get_thumb(thumb + '.png')
|
||||
else:
|
||||
thumb = item.thumbnails
|
||||
|
||||
# Remove args from title
|
||||
if item.args: item.title = item.title.replace(' || ' + str(item.args), '')
|
||||
|
||||
item.title = re.sub(r'\s*\{[^\}]+\}','',item.title)
|
||||
return itemlist
|
||||
else:
|
||||
return get_thumb('next.png')
|
||||
|
||||
@@ -296,17 +296,18 @@ def scrape(func):
|
||||
it = Item(
|
||||
channel=item.channel,
|
||||
action=action,
|
||||
contentType= 'episode' if item.action == 'episodios' else item.contentType,
|
||||
contentType= 'episode' if (action == 'findvideos' and item.contentType == 'tvshow') else item.contentType,
|
||||
title=longtitle,
|
||||
fulltitle=title,
|
||||
show=item.show if item.action == 'episodios' else title,
|
||||
fulltitle=item.fulltitle if (action == 'findvideos' and item.contentType != 'movie') else title,
|
||||
show=item.show if (action == 'findvideos' and item.contentType != 'movie') else title,
|
||||
quality=scraped["quality"],
|
||||
url=scraped["url"],
|
||||
infoLabels=infolabels,
|
||||
thumbnail=scraped["thumb"],
|
||||
args=item.args
|
||||
args=item.args,
|
||||
contentSerieName = title if (action == 'episodios' and item.contentType != 'movie') else ''
|
||||
)
|
||||
|
||||
|
||||
for lg in list(set(listGroups).difference(known_keys)):
|
||||
it.__setattr__(lg, match[listGroups.index(lg)])
|
||||
|
||||
@@ -315,13 +316,13 @@ def scrape(func):
|
||||
itemlist.append(it)
|
||||
checkHost(item, itemlist)
|
||||
|
||||
if ('patronMenu' not in args and item.contentType == "tvshow" and (action == "findvideos" and action != "play")) \
|
||||
if (item.contentType == "tvshow" and (action != "findvideos" and action != "play")) \
|
||||
or (item.contentType == "episode" and action != "play") \
|
||||
or (item.contentType == "movie" and action != "play") :
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
else:
|
||||
for it in itemlist:
|
||||
it.infoLabels = item.infoLabels
|
||||
# else: # Si perde item show :(
|
||||
# for it in itemlist:
|
||||
# it.infoLabels = item.infoLabels
|
||||
|
||||
if 'itemlistHook' in args:
|
||||
itemlist = args['itemlistHook'](itemlist)
|
||||
@@ -351,7 +352,7 @@ def scrape(func):
|
||||
videolibrary(itemlist, item)
|
||||
|
||||
if 'patronMenu' in args:
|
||||
itemlist = thumb(itemlist)
|
||||
itemlist = thumb(itemlist, genre=True)
|
||||
|
||||
if 'fullItemlistHook' in args:
|
||||
itemlist = args['fullItemlistHook'](itemlist)
|
||||
@@ -521,7 +522,6 @@ def menuItem(itemlist, filename, title='', action='', url='', contentType='movie
|
||||
# Apply auto Thumbnails at the menus
|
||||
from channelselector import thumb
|
||||
thumb(itemlist)
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -578,7 +578,7 @@ def menu(func):
|
||||
if dictUrl[name] is not None and type(dictUrl[name]) is not str:
|
||||
for sub, var in dictUrl[name]:
|
||||
menuItem(itemlist, filename,
|
||||
title = sub + ' submenu',
|
||||
title = sub + ' submenu' + typo(title,'_ {}'),
|
||||
url = host + var[0] if len(var) > 0 else '',
|
||||
action = var[1] if len(var) > 1 else 'peliculas',
|
||||
args=var[2] if len(dictUrl[name]) > 2 else '',
|
||||
|
||||
@@ -56,8 +56,8 @@ def show_option(channel, itemlist, text_color=colorKOD, thumbnail=None, fanart=N
|
||||
|
||||
if thumbnail == None:
|
||||
thumbnail = get_thumb('autoplay.png')
|
||||
if fanart == None:
|
||||
fanart = get_thumb('autoplay.png')
|
||||
# if fanart == None:
|
||||
# fanart = get_thumb('autoplay.png')
|
||||
|
||||
plot_autoplay = config.get_localized_string(60399)
|
||||
itemlist.append(
|
||||
@@ -67,7 +67,7 @@ def show_option(channel, itemlist, text_color=colorKOD, thumbnail=None, fanart=N
|
||||
text_color=text_color,
|
||||
text_bold=True,
|
||||
thumbnail=thumbnail,
|
||||
fanart=fanart,
|
||||
# fanart=fanart,
|
||||
plot=plot_autoplay,
|
||||
from_channel=channel,
|
||||
folder=False
|
||||
|
||||
Reference in New Issue
Block a user