Ipostazioni Ragruppate
This commit is contained in:
+4
-56
@@ -8,36 +8,6 @@
|
||||
"movie"
|
||||
],
|
||||
"settings": [
|
||||
{
|
||||
"type": "label",
|
||||
"label": "@70229",
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "library_add",
|
||||
"type": "bool",
|
||||
"label": "@70230",
|
||||
"default": false,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "library_move",
|
||||
"type": "bool",
|
||||
"label": "@70231",
|
||||
"default": false,
|
||||
"enabled": "eq(-1,true)",
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "browser",
|
||||
"type": "bool",
|
||||
"label": "@70232",
|
||||
"default": true,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"label": "@70243",
|
||||
@@ -122,28 +92,6 @@
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "quality",
|
||||
"type": "list",
|
||||
"label": "@70240",
|
||||
"lvalues": [
|
||||
"@70241",
|
||||
"HD 1080",
|
||||
"HD 720",
|
||||
"SD"
|
||||
],
|
||||
"default": 0,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "server_speed",
|
||||
"type": "bool",
|
||||
"label": "@70242",
|
||||
"default": true,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "server_reorder",
|
||||
"type": "list",
|
||||
@@ -161,10 +109,10 @@
|
||||
"type": "list",
|
||||
"label": "@70246",
|
||||
"lvalues": [
|
||||
"Ita, Sub, Eng, Vos, Vosi",
|
||||
"Eng, Ita, Sub, Vos, Vosi",
|
||||
"Sub, Ita, Eng, Vos, Vosi",
|
||||
"Eng, Sub, Ita, Vos, Vosi"
|
||||
"Ita, Sub, Eng",
|
||||
"Eng, Ita, Sub",
|
||||
"Sub, Ita, Eng",
|
||||
"Eng, Sub, Ita"
|
||||
],
|
||||
"default": 0,
|
||||
"enabled": "eq(-1,'@70245')",
|
||||
|
||||
+12
-12
@@ -112,7 +112,7 @@ def mainlist(item):
|
||||
contentType=item.contentType, contentChannel=item.contentChannel,
|
||||
contentSerieName=item.contentSerieName))
|
||||
|
||||
if not item.contentType == "tvshow" and config.get_setting("browser", "downloads") == True:
|
||||
if not item.contentType == "tvshow" and config.get_setting("browser") == True:
|
||||
itemlist.insert(0, Item(channel=item.channel, action="browser", title=support.typo(config.get_localized_string(70222),'bold'),url=DOWNLOAD_PATH))
|
||||
|
||||
if not item.contentType == "tvshow":
|
||||
@@ -285,7 +285,7 @@ def move_to_libray(item):
|
||||
library_path = filetools.join(move_path, *filetools.split(item.downloadFilename))
|
||||
final_path = download_path
|
||||
|
||||
if config.get_setting("library_add", "downloads") == True and config.get_setting("library_move", "downloads") == True:
|
||||
if config.get_setting("library_add") == True and config.get_setting("library_move") == True:
|
||||
if not filetools.isdir(filetools.dirname(library_path)):
|
||||
filetools.mkdir(filetools.dirname(library_path))
|
||||
|
||||
@@ -322,7 +322,7 @@ def move_to_libray(item):
|
||||
xbmc.sleep(500)
|
||||
xbmc_videolibrary.clean()
|
||||
|
||||
if config.get_setting("library_add", "downloads") == True and config.get_setting("library_move", "downloads") == False:
|
||||
if config.get_setting("library_add") == True and config.get_setting("library_move") == False:
|
||||
if filetools.isfile(final_path):
|
||||
if item.contentType == "movie" and item.infoLabels["tmdb_id"]:
|
||||
library_item = Item(title=config.get_localized_string(70228) % item.downloadFilename, channel="downloads",
|
||||
@@ -471,7 +471,7 @@ def sort_method(item):
|
||||
"VOSI": ["VOSI"]}
|
||||
|
||||
order_list_calidad = ["BLURAY", "FULLHD", "HD", "480P", "360P", "240P"]
|
||||
order_list_calidad = quality_orders[int(config.get_setting("quality", "downloads"))]
|
||||
order_list_calidad = quality_orders[int(config.get_setting("quality"))]
|
||||
match_list_calidad = {"BLURAY": ["BR", "BLURAY", '4K'],
|
||||
"FULLHD": ["FULLHD", "FULL HD", "1080", "HD1080", "HD 1080", "1080p"],
|
||||
"HD": ["HD", "HD REAL", "HD 720", "720", "HDTV", "720p"],
|
||||
@@ -482,7 +482,7 @@ def sort_method(item):
|
||||
value = (get_match_list(item.title, match_list_idimas, order_list_idiomas, ignorecase=True, only_ascii=True).index, \
|
||||
get_match_list(item.title, match_list_calidad, order_list_calidad, ignorecase=True, only_ascii=True).index)
|
||||
|
||||
if config.get_setting("server_speed", "downloads"):
|
||||
if config.get_setting("server_speed"):
|
||||
value += tuple([get_server_position(item.server)])
|
||||
|
||||
return value
|
||||
@@ -723,8 +723,8 @@ def start_download(item):
|
||||
|
||||
|
||||
def get_episodes(item):
|
||||
logger.info("contentAction: %s | contentChannel: %s | contentType: %s" % (
|
||||
item.contentAction, item.contentChannel, item.contentType))
|
||||
logger.info("contentAction: %s | contentChannel: %s | contentType: %s" % (item.contentAction, item.contentChannel, item.contentType))
|
||||
|
||||
if 'dlseason' in item:
|
||||
season = True
|
||||
season_number = item.dlseason
|
||||
@@ -782,13 +782,13 @@ def get_episodes(item):
|
||||
episode.contentTitle = re.sub("\[[^\]]+\]|\([^\)]+\)|\d*x\d*\s*-", "", episode.title).strip()
|
||||
|
||||
episode.downloadFilename = filetools.validate_path(filetools.join(item.downloadFilename, "%dx%0.2d - %s" % (episode.contentSeason, episode.contentEpisodeNumber, episode.contentTitle.strip())))
|
||||
itemlist.append(episode)
|
||||
|
||||
if season:
|
||||
if scrapertools.find_single_match(episode.title, r'(\d+)x') == season_number:
|
||||
itemlist.append(episode)
|
||||
if season:
|
||||
if scrapertools.find_single_match(episode.title, r'(\d+)x') == season_number:
|
||||
itemlist.append(episode)
|
||||
else:
|
||||
itemlist.append(episode)
|
||||
|
||||
|
||||
# Cualquier otro resultado no nos vale, lo ignoramos
|
||||
else:
|
||||
logger.info("Omitiendo item no válido: %s" % episode.tostring())
|
||||
|
||||
@@ -82,7 +82,7 @@ def mainlist(item):
|
||||
return itemlist
|
||||
|
||||
def server_config(item):
|
||||
return platformtools.show_channel_settings(channelpath=filetools.join(config.get_runtime_path(), "specials", item.config))
|
||||
return platformtools.show_channel_settings(channelpath=filetools.join(config.get_runtime_path(), "server", item.config))
|
||||
|
||||
def now_on_misc_film(item):
|
||||
logger.info("filmontv tvoggi")
|
||||
|
||||
@@ -56,6 +56,8 @@ if xinfoplus_set == config.get_localized_string(70129):
|
||||
set_animation = False
|
||||
if xinfoplus_set == config.get_localized_string(70130):
|
||||
set_animation = True
|
||||
else:
|
||||
set_animation = xinfoplus_set
|
||||
|
||||
def start(item, recomendaciones=[], from_window=False):
|
||||
if from_window:
|
||||
|
||||
+2
-2
@@ -591,8 +591,8 @@ def menu_opciones(item):
|
||||
# itemlist.append(Item(channel=item.channel, action="setting_channel", extra="latino", title=config.get_localized_string(70213),
|
||||
# thumbnail=get_thumb("channels_documentary.png"), folder=False))
|
||||
|
||||
itemlist.append(Item(channel=item.channel, action="setting_channel", extra="Torrent", title=config.get_localized_string(70214),
|
||||
thumbnail=get_thumb("channels_documentary.png"), folder=False))
|
||||
# itemlist.append(Item(channel=item.channel, action="setting_channel", extra="torrent", title=config.get_localized_string(70214),
|
||||
# thumbnail=get_thumb("channels_documentary.png"), folder=False))
|
||||
|
||||
itemlist.append(Item(channel=item.channel, action="setting_channel", extra="documentales",
|
||||
title=config.get_localized_string(60530),
|
||||
|
||||
+3
-1
@@ -57,7 +57,9 @@ def next_ep(item):
|
||||
time_over = False
|
||||
time_limit = time() + 30
|
||||
time_steps = [20,30,40,50,60,70,80,90,100,110,120]
|
||||
TimeFromEnd = time_steps[config.get_setting('next_ep_seconds')]
|
||||
time_setting = config.get_setting('next_ep_seconds')
|
||||
TimeFromEnd = time_setting if time_setting > 10 else time_steps[time_setting]
|
||||
|
||||
|
||||
# wait until the video plays
|
||||
while not platformtools.is_playing() and time() < time_limit:
|
||||
|
||||
+8
-8
@@ -47,7 +47,7 @@ def mainlist(item):
|
||||
|
||||
Item(channel=item.channel, title=typo(config.get_localized_string(59994), 'color kod bold'), action='opciones', thumbnail=get_thumb('setting_0.png')),
|
||||
|
||||
Item(channel=item.channel, title=typo(config.get_localized_string(30100), 'color kod bold'), action='settings', thumbnail=get_thumb('setting_0.png'))]
|
||||
Item(channel='shortcuts', title=typo(config.get_localized_string(30100), 'color kod bold'), action='SettingOnPosition', category=3, thumbnail=get_thumb('setting_0.png'))]
|
||||
|
||||
itemlist = set_context(itemlist)
|
||||
|
||||
@@ -114,7 +114,8 @@ def new_search(item):
|
||||
logger.info()
|
||||
|
||||
itemlist = []
|
||||
if channeltools.get_channel_setting('last_search', 'search'):
|
||||
if config.get_setting('last_search'):
|
||||
# if channeltools.get_channel_setting('last_search', 'search'):
|
||||
last_search = channeltools.get_channel_setting('Last_searched', 'search', '')
|
||||
else:
|
||||
last_search = ''
|
||||
@@ -253,7 +254,7 @@ def channel_search(item):
|
||||
if it in valid:
|
||||
continue
|
||||
if mode == 'all' or (it.contentType and mode == it.contentType):
|
||||
if config.get_setting('result_mode', 'search') != 0:
|
||||
if config.get_setting('result_mode') != 0:
|
||||
if config.get_localized_string(30992) not in it.title:
|
||||
it.title += typo(ch_name,'_ [] color kod bold')
|
||||
results.append(it)
|
||||
@@ -267,7 +268,7 @@ def channel_search(item):
|
||||
if not grouped:
|
||||
continue
|
||||
# to_temp[key] = grouped
|
||||
if config.get_setting('result_mode', 'search') == 0:
|
||||
if config.get_setting('result_mode') == 0:
|
||||
if not config.get_setting('unify'):
|
||||
title = typo(ch_name,'bold') + typo(str(len(grouped)), '_ [] color kod bold')
|
||||
else:
|
||||
@@ -371,9 +372,8 @@ def settings(item):
|
||||
return platformtools.show_channel_settings(caption=config.get_localized_string(59993))
|
||||
|
||||
def set_workers():
|
||||
list_mode=[None,1,2,4,6,8,16,24,32,64]
|
||||
index = config.get_setting('thread_number', 'search')
|
||||
return list_mode[index]
|
||||
workers = config.get_setting('thread_number') if config.get_setting('thread_number') > 0 else None
|
||||
return workers
|
||||
|
||||
def setting_channel_new(item):
|
||||
import xbmcgui
|
||||
@@ -723,7 +723,7 @@ def get_from_temp(item):
|
||||
|
||||
def save_search(text):
|
||||
if text:
|
||||
saved_searches_limit = int((10, 20, 30, 40)[int(config.get_setting("saved_searches_limit", "search"))])
|
||||
saved_searches_limit = config.get_setting("saved_searches_limit")
|
||||
|
||||
current_saved_searches_list = config.get_setting("saved_searches_list", "search")
|
||||
if current_saved_searches_list is None:
|
||||
|
||||
+8
-8
@@ -155,7 +155,7 @@ def setting_torrent(item):
|
||||
{
|
||||
"id": "mct_buffer",
|
||||
"type": "text",
|
||||
"label": "MCT - Tamaño del Buffer a descargar antes de la reproducción",
|
||||
"label": "MCT - " + config.get_localized_string(70758),
|
||||
"default": BUFFER,
|
||||
"enabled": True,
|
||||
"visible": "eq(-1,%s)" % torrent_options[2]
|
||||
@@ -163,7 +163,7 @@ def setting_torrent(item):
|
||||
{
|
||||
"id": "mct_download_path",
|
||||
"type": "text",
|
||||
"label": "MCT - Ruta de la carpeta de descarga",
|
||||
"label": "MCT - " + config.get_localized_string(30017),
|
||||
"default": DOWNLOAD_PATH,
|
||||
"enabled": True,
|
||||
"visible": "eq(-2,%s)" % torrent_options[2]
|
||||
@@ -171,7 +171,7 @@ def setting_torrent(item):
|
||||
{
|
||||
"id": "bt_buffer",
|
||||
"type": "text",
|
||||
"label": "BT - Tamaño del Buffer a descargar antes de la reproducción",
|
||||
"label": "BT - " + config.get_localized_string(70758),
|
||||
"default": BUFFER_BT,
|
||||
"enabled": True,
|
||||
"visible": "eq(-3,%s)" % torrent_options[1]
|
||||
@@ -179,7 +179,7 @@ def setting_torrent(item):
|
||||
{
|
||||
"id": "bt_download_path",
|
||||
"type": "text",
|
||||
"label": "BT - Ruta de la carpeta de descarga",
|
||||
"label": "BT - " + config.get_localized_string(30017),
|
||||
"default": DOWNLOAD_PATH_BT,
|
||||
"enabled": True,
|
||||
"visible": "eq(-4,%s)" % torrent_options[1]
|
||||
@@ -187,7 +187,7 @@ def setting_torrent(item):
|
||||
{
|
||||
"id": "mct_download_limit",
|
||||
"type": "text",
|
||||
"label": "Límite (en Kb's) de la velocidad de descarga en segundo plano (NO afecta a RAR)",
|
||||
"label": config.get_localized_string(70759),
|
||||
"default": DOWNLOAD_LIMIT,
|
||||
"enabled": True,
|
||||
"visible": "eq(-5,%s) | eq(-5,%s)" % (torrent_options[1], torrent_options[2])
|
||||
@@ -195,7 +195,7 @@ def setting_torrent(item):
|
||||
{
|
||||
"id": "mct_rar_unpack",
|
||||
"type": "bool",
|
||||
"label": "¿Quiere que se descompriman los archivos RAR y ZIP para su reproducción?",
|
||||
"label": config.get_localized_string(70760),
|
||||
"default": RAR,
|
||||
"enabled": True,
|
||||
"visible": True
|
||||
@@ -203,7 +203,7 @@ def setting_torrent(item):
|
||||
{
|
||||
"id": "mct_background_download",
|
||||
"type": "bool",
|
||||
"label": "¿Se procesa la descompresión de RARs en segundo plano?",
|
||||
"label": config.get_localized_string(70761),
|
||||
"default": BACKGROUND,
|
||||
"enabled": True,
|
||||
"visible": True
|
||||
@@ -211,7 +211,7 @@ def setting_torrent(item):
|
||||
{
|
||||
"id": "magnet2torrent",
|
||||
"type": "bool",
|
||||
"label": "¿Quiere convertir los Magnets a Torrents para ver tamaños y almacenarlos?",
|
||||
"label": config.get_localized_string(70762),
|
||||
"default": MAGNET2TORRENT,
|
||||
"enabled": True,
|
||||
"visible": True
|
||||
|
||||
+124
-1
@@ -1,5 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from platformcode import logger
|
||||
|
||||
def context():
|
||||
from platformcode import config
|
||||
context = []
|
||||
@@ -20,4 +22,125 @@ def shortcut_menu(item):
|
||||
|
||||
def settings_menu(item):
|
||||
from platformcode import config
|
||||
config.open_settings()
|
||||
config.open_settings()
|
||||
|
||||
def servers_menu(item):
|
||||
# from core.support import dbg; dbg()
|
||||
from core import servertools
|
||||
from core.item import Item
|
||||
from platformcode import config, platformtools
|
||||
from specials import setting
|
||||
|
||||
names = []
|
||||
ids = []
|
||||
|
||||
if item.type == 'debriders':
|
||||
action = 'server_debrid_config'
|
||||
server_list = list(servertools.get_debriders_list().keys())
|
||||
for server in server_list:
|
||||
server_parameters = servertools.get_server_parameters(server)
|
||||
if server_parameters['has_settings']:
|
||||
names.append(server_parameters['name'])
|
||||
ids.append(server)
|
||||
|
||||
select = platformtools.dialog_select(config.get_localized_string(60552), names)
|
||||
ID = ids[select]
|
||||
|
||||
it = Item(channel = 'settings',
|
||||
action = action,
|
||||
config = ID)
|
||||
return setting.server_debrid_config(it)
|
||||
else:
|
||||
action = 'server_config'
|
||||
server_list = list(servertools.get_servers_list().keys())
|
||||
for server in sorted(server_list):
|
||||
server_parameters = servertools.get_server_parameters(server)
|
||||
if server_parameters["has_settings"] and [x for x in server_parameters["settings"] if x["id"] not in ["black_list", "white_list"]]:
|
||||
names.append(server_parameters['name'])
|
||||
ids.append(server)
|
||||
|
||||
select = platformtools.dialog_select(config.get_localized_string(60538), names)
|
||||
ID = ids[select]
|
||||
|
||||
it = Item(channel = 'settings',
|
||||
action = action,
|
||||
config = ID)
|
||||
|
||||
return setting.server_config(it)
|
||||
|
||||
def channels_menu(item):
|
||||
import channelselector
|
||||
from core import channeltools
|
||||
from core.item import Item
|
||||
from platformcode import config, platformtools
|
||||
from specials import setting
|
||||
|
||||
names = []
|
||||
ids = []
|
||||
|
||||
channel_list = channelselector.filterchannels("all")
|
||||
for channel in channel_list:
|
||||
if not channel.channel:
|
||||
continue
|
||||
channel_parameters = channeltools.get_channel_parameters(channel.channel)
|
||||
if channel_parameters["has_settings"]:
|
||||
names.append(channel.title)
|
||||
ids.append(channel.channel)
|
||||
|
||||
select = platformtools.dialog_select(config.get_localized_string(60537), names)
|
||||
ID = ids[select]
|
||||
|
||||
it = Item(channel='settings',
|
||||
action="channel_config",
|
||||
config=ID)
|
||||
|
||||
return setting.channel_config(it)
|
||||
|
||||
def check_channels(item):
|
||||
from specials import setting
|
||||
from platformcode import config, platformtools
|
||||
# from core.support import dbg; dbg()
|
||||
item.channel = 'setting'
|
||||
item.extra = 'lib_check_datajson'
|
||||
itemlist = setting.conf_tools(item)
|
||||
text = ''
|
||||
for item in itemlist:
|
||||
text += item.title + '\n'
|
||||
|
||||
platformtools.dialog_textviewer(config.get_localized_string(60537), text)
|
||||
|
||||
|
||||
def SettingOnPosition(item):
|
||||
# addonId is the Addon ID
|
||||
# item.category is the Category (Tab) offset (0=first, 1=second, 2...etc)
|
||||
# item.setting is the Setting (Control) offse (0=first, 1=second, 2...etc)
|
||||
# This will open settings dialog focusing on fourth setting (control) inside the third category (tab)
|
||||
|
||||
import xbmc
|
||||
|
||||
xbmc.executebuiltin('Addon.OpenSettings(plugin.video.kod)')
|
||||
category = item.category if item.category else 0
|
||||
setting = item.setting if item.setting else 0
|
||||
logger.info('SETTING= ' + str(setting))
|
||||
xbmc.executebuiltin('SetFocus(%i)' % (category - 100))
|
||||
xbmc.executebuiltin('SetFocus(%i)' % (setting - 80))
|
||||
|
||||
|
||||
def select(item):
|
||||
from platformcode import config, platformtools
|
||||
# item.id = setting ID
|
||||
# item.type = labels or values
|
||||
# item.values = values separeted by |
|
||||
# item.label = string or string id
|
||||
|
||||
label = config.get_localized_string(int(item.label)) if item.label.isdigit() else item.label
|
||||
values = []
|
||||
|
||||
if item.type == 'labels':
|
||||
for val in item.values.split('|'):
|
||||
values.append(config.get_localized_string(int(val)))
|
||||
else:
|
||||
values = item.values.split('|')
|
||||
|
||||
select = platformtools.dialog_select(label, values)
|
||||
config.set_setting(item.id, values[select])
|
||||
Reference in New Issue
Block a user