Add Custom Theme Setting and Auto Thumb (partial)
This commit is contained in:
@@ -224,25 +224,54 @@ def filterchannels(category, view="thumb_"):
|
||||
return channelslist
|
||||
|
||||
|
||||
# def get_thumb(thumb_name, view="thumb_", auto=False):
|
||||
|
||||
# if auto:
|
||||
# thumbnail = ''
|
||||
|
||||
# thumb_name = unify.set_genre(unify.simplify(thumb_name))
|
||||
|
||||
|
||||
# if thumb_name in thumb_dict:
|
||||
# thumbnail = thumb_dict[thumb_name]
|
||||
# return thumbnail
|
||||
# else:
|
||||
# icon_pack_name = config.get_setting('icon_set', default="default")
|
||||
# if icon_pack_name == "default":
|
||||
# resource_path = os.path.join(config.get_runtime_path(), "resources", "media", "themes")
|
||||
# else:
|
||||
# resource_path = "https://raw.githubusercontent.com/alfa-addon/media/master/themes/"
|
||||
|
||||
# media_path = os.path.join(resource_path, icon_pack_name)
|
||||
|
||||
# return os.path.join(media_path, view + thumb_name)
|
||||
|
||||
def get_thumb(thumb_name, view="thumb_", auto=False):
|
||||
|
||||
if auto:
|
||||
thumbnail = ''
|
||||
|
||||
thumb_name = unify.set_genre(unify.simplify(thumb_name))
|
||||
|
||||
|
||||
|
||||
if thumb_name in thumb_dict:
|
||||
thumbnail = thumb_dict[thumb_name]
|
||||
return thumbnail
|
||||
|
||||
else:
|
||||
icon_pack_name = config.get_setting('icon_set', default="default")
|
||||
if icon_pack_name == "default":
|
||||
resource_path = os.path.join(config.get_runtime_path(), "resources", "media", "themes")
|
||||
else:
|
||||
resource_path = "https://raw.githubusercontent.com/alfa-addon/media/master/themes/"
|
||||
|
||||
|
||||
if auto_filter() == 'ita' and icon_pack_name == "default":
|
||||
icon_pack_name = 'default_ita'
|
||||
resource_path = os.path.join(config.get_runtime_path(), "resources", "media", "themes")
|
||||
media_path = os.path.join(resource_path, icon_pack_name)
|
||||
if config.get_setting('enable_custom_theme') and config.get_setting('custom_theme'):
|
||||
media_path = config.get_setting('custom_theme')
|
||||
elif os.path.isdir(media_path) == False:
|
||||
media_path = os.path.join("https://raw.githubusercontent.com/alfa-addon/media/master/themes/", icon_pack_name)
|
||||
else:
|
||||
media_path = os.path.join(resource_path, icon_pack_name)
|
||||
|
||||
|
||||
return os.path.join(media_path, view + thumb_name)
|
||||
|
||||
@@ -299,3 +328,43 @@ def auto_filter():
|
||||
lang = config.get_setting("channel_language", default="all")
|
||||
|
||||
return lang
|
||||
|
||||
def thumb(itemlist):
|
||||
|
||||
for item in itemlist:
|
||||
thumb = ''
|
||||
logger.info("TITLE= " + item.title.lower())
|
||||
if 'film' in item.title.lower():
|
||||
thumb = 'channels_movie'
|
||||
if 'serie' in item.title.lower():
|
||||
thumb = 'channels_tvshow'
|
||||
if 'autoplay' in item.title.lower():
|
||||
thumb = 'autoplay'
|
||||
|
||||
|
||||
|
||||
|
||||
if 'hd' in item.title.lower():
|
||||
thumb = thumb + '_hd'
|
||||
if '4k' in item.title.lower():
|
||||
thumb = thumb + '_4k'
|
||||
if any( word in item.title.lower() for word in ['lettera','lista','alfabetico','a-z']):
|
||||
thumb = thumb + '_az'
|
||||
if 'anno' in item.title.lower():
|
||||
thumb = thumb + '_year'
|
||||
if 'genere' in item.title.lower():
|
||||
thumb = thumb + '_genre'
|
||||
|
||||
|
||||
|
||||
if 'cerca' in item.title.lower():
|
||||
thumb = 'search'
|
||||
if 'film' in item.title.lower():
|
||||
thumb = thumb + '_movie'
|
||||
if 'serie' in item.title.lower():
|
||||
thumb = thumb + '_tvshow'
|
||||
|
||||
item.thumbnail = get_thumb(thumb + '.png')
|
||||
item.fanart = get_thumb(thumb + '.png', 'fanart_')
|
||||
|
||||
return itemlist
|
||||
@@ -4934,3 +4934,11 @@ msgstr "Autoplay (Enable autoplay on all supported channels)"
|
||||
msgctxt "#70563"
|
||||
msgid "Italian"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#70564"
|
||||
msgid "Enable Custom Theme"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#70565"
|
||||
msgid "Custom Theme Path"
|
||||
msgstr ""
|
||||
|
||||
@@ -4922,3 +4922,14 @@ msgstr "Autoplay (Abilita autoplay in tutti i canali)"
|
||||
msgctxt "#70563"
|
||||
msgid "Italian"
|
||||
msgstr "Italiano"
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
msgctxt "#70564"
|
||||
msgid "Enable Custom Theme"
|
||||
msgstr "Abilita Tema Personalizzato"
|
||||
|
||||
msgctxt "#70565"
|
||||
msgid "Custom Theme Path"
|
||||
msgstr "Percorso Tema Personalizzato"
|
||||
>>>>>>> e253911b... Add Custom Theme Setting and Auto Thumb (partial)
|
||||
|
||||
@@ -4935,12 +4935,10 @@ msgctxt "#70563"
|
||||
msgid "Italian"
|
||||
msgstr "Italiano"
|
||||
|
||||
msgctxt "#70564"
|
||||
msgid "Enable Custom Theme"
|
||||
msgstr "Abilita Tema Personalizado"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
msgctxt "#70565"
|
||||
msgid "Custom Theme Path"
|
||||
msgstr "Percorso Tema Personalizado"
|
||||
|
||||
@@ -4935,10 +4935,10 @@ msgctxt "#70563"
|
||||
msgid "Italian"
|
||||
msgstr "Italiano"
|
||||
|
||||
msgctxt "#70564"
|
||||
msgid "Enable Custom Theme"
|
||||
msgstr "Abilita Tema Personalizado"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
msgctxt "#70565"
|
||||
msgid "Custom Theme Path"
|
||||
msgstr "Percorso Tema Personalizado"
|
||||
|
||||
@@ -4935,10 +4935,10 @@ msgctxt "#70563"
|
||||
msgid "Italian"
|
||||
msgstr "Italiano"
|
||||
|
||||
msgctxt "#70564"
|
||||
msgid "Enable Custom Theme"
|
||||
msgstr "Abilita Tema Personalizado"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
msgctxt "#70565"
|
||||
msgid "Custom Theme Path"
|
||||
msgstr "Percorso Tema Personalizado"
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
</category>
|
||||
<category label="70126">
|
||||
<setting id="icon_set" type="labelenum" label="70108" values="default|dark|angedam" default="default"/>
|
||||
<setting id="enable_custom_theme" type="bool" label="70564" default="false"/>
|
||||
<setting id="custom_theme" type="folder" label="70565" default="" visible="eq(-1,true)"/>
|
||||
<setting id="infoplus_set" type="labelenum" label="70128" lvalues="70129|70130" default="70129"/>
|
||||
<setting id="video_thumbnail_type" type="enum" label="70131" lvalues="70132|70133" default="0"/>
|
||||
<setting label="70167" type="lsep"/>
|
||||
|
||||
Reference in New Issue
Block a user