KoD 0.6
-Nuova ricerca globale -migliorie prestazionali in generale -fix vari ai server
This commit is contained in:
+47
-19
@@ -97,6 +97,7 @@ def show_channels(item):
|
||||
def show_menu(item):
|
||||
global list_data
|
||||
itemlist = []
|
||||
add_search = True
|
||||
support.log()
|
||||
# If Second Level Menu
|
||||
if item.menu:
|
||||
@@ -127,11 +128,16 @@ def show_menu(item):
|
||||
filterkey=key if not url else '' ))
|
||||
|
||||
if menu.has_key('search'):
|
||||
if type(menu['search']) == dict and menu['search'].has_key('url'):
|
||||
url = relative('url', menu['search'], item.path)
|
||||
else:
|
||||
url = ''
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=typo('Cerca ' + item.fulltitle +'...','color kod bold'),
|
||||
thumbnail=get_thumb('search.png'),
|
||||
action='search',
|
||||
url=item.url,
|
||||
custom_url=url,
|
||||
path=item.path))
|
||||
return itemlist
|
||||
|
||||
@@ -146,16 +152,28 @@ def show_menu(item):
|
||||
url = relative('link', option, item.path)
|
||||
submenu = option['submenu'] if option.has_key('submenu') else []
|
||||
level2 = option['level2'] if option.has_key('level2') else []
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=format_title(option['title']),
|
||||
fulltitle=option['title'],
|
||||
thumbnail=thumbnail,
|
||||
fanart=fanart,
|
||||
plot=plot,
|
||||
action='show_menu',
|
||||
url=url,
|
||||
path=item.path,
|
||||
menu=level2))
|
||||
if option.has_key('title'):
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=format_title(option['title']),
|
||||
fulltitle=option['title'],
|
||||
thumbnail=thumbnail,
|
||||
fanart=fanart,
|
||||
plot=plot,
|
||||
action='show_menu',
|
||||
url=url,
|
||||
path=item.path,
|
||||
menu=level2))
|
||||
if option.has_key('search'):
|
||||
menu = json_data['menu']
|
||||
if type(option['search']) == dict and option['search'].has_key('url'):
|
||||
url = relative('url', option['search'], item.path)
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=typo('Cerca nel Canale...','color kod bold'),
|
||||
thumbnail=get_thumb('search.png'),
|
||||
action='search',
|
||||
url=url,
|
||||
path=item.path))
|
||||
add_search = False
|
||||
|
||||
if submenu:
|
||||
for key in submenu:
|
||||
@@ -177,6 +195,10 @@ def show_menu(item):
|
||||
action='submenu',
|
||||
filterkey=key))
|
||||
if submenu.has_key('search'):
|
||||
if type(submenu['search']) == dict and submenu['search'].has_key('url'):
|
||||
url = relative('url', submenu['search'], item.path)
|
||||
else:
|
||||
url = ''
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=typo('Cerca ' + option['title'] +'...','color kod bold'),
|
||||
thumbnail=get_thumb('search.png'),
|
||||
@@ -205,13 +227,13 @@ def show_menu(item):
|
||||
itemlist += list_all(item)
|
||||
|
||||
# add Search
|
||||
if 'channel_name' in json_data:
|
||||
if 'channel_name' in json_data and add_search:
|
||||
itemlist.append(Item(channel=item.channel,
|
||||
title=typo('Cerca nel Canale...','color kod bold'),
|
||||
thumbnail=get_thumb('search.png'),
|
||||
action='search',
|
||||
url=item.url,
|
||||
path=item.path))
|
||||
title=typo('Cerca nel Canale...','color kod bold'),
|
||||
thumbnail=get_thumb('search.png'),
|
||||
action='search',
|
||||
url=item.url,
|
||||
path=item.path))
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -245,6 +267,7 @@ def submenu(item):
|
||||
thumbnail = ''
|
||||
plot = ''
|
||||
if item.filterkey in ['director','actors']:
|
||||
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||
load_info = load_json('http://api.themoviedb.org/3/search/person/?api_key=' + tmdb_api + '&language=' + lang + '&query=' + filter)
|
||||
id = str(load_info['results'][0]['id']) if load_info.has_key('results') else ''
|
||||
if id:
|
||||
@@ -655,7 +678,9 @@ def add_channel(item):
|
||||
|
||||
community_json = open(path, "r")
|
||||
community_json = jsontools.load(community_json.read())
|
||||
id = len(community_json['channels']) + 1
|
||||
id = 1
|
||||
while community_json['channels'].has_key(str(id)):
|
||||
id +=1
|
||||
community_json['channels'][id]=(channel_to_add)
|
||||
|
||||
with open(path, "w") as file:
|
||||
@@ -732,6 +757,8 @@ def format_title(title):
|
||||
|
||||
def search(item, text):
|
||||
support.log('Search ', text)
|
||||
if item.custom_url:
|
||||
item.url=item.custom_url + text
|
||||
itemlist = []
|
||||
json_data = load_json(item)
|
||||
|
||||
@@ -782,8 +809,9 @@ def load_links(item, itemlist, json_data, text):
|
||||
|
||||
if json_data.has_key('menu'):
|
||||
for option in json_data['menu']:
|
||||
json_data = load_json(option['link'] if option['link'].startswith('http') else item.path+option['link'])
|
||||
load_links(item, itemlist, json_data, text)
|
||||
if option.has_key('link'):
|
||||
json_data = load_json(option['link'] if option['link'].startswith('http') else item.path+option['link'])
|
||||
load_links(item, itemlist, json_data, text)
|
||||
else:
|
||||
links(item, itemlist, json_data, text)
|
||||
|
||||
|
||||
+11
-15
@@ -2,29 +2,25 @@
|
||||
# -*- OVERRIDE RESOLVE DNS -*-
|
||||
|
||||
from platformcode import config
|
||||
from core import support
|
||||
|
||||
##if config.get_setting('resolver_dns') or config.get_setting('resolver_dns_custom'):
|
||||
if config.get_setting('resolver_dns'):
|
||||
import xbmc
|
||||
from lib import dns
|
||||
import dns.resolver
|
||||
from dns import resolver, name
|
||||
from dns.resolver import override_system_resolver
|
||||
import dns.name
|
||||
import socket
|
||||
import requests
|
||||
|
||||
res = dns.resolver.Resolver(configure=True)
|
||||
|
||||
"""
|
||||
legge le impostazioni dalla configurazione
|
||||
e setta i relativi DNS
|
||||
"""
|
||||
from core import support
|
||||
|
||||
support.log("platform Android: {}".format(xbmc.getCondVisibility('System.Platform.Android')))
|
||||
if xbmc.getCondVisibility('System.Platform.Android') == True:
|
||||
res = resolver.Resolver(filename='/system/etc/resolv.conf', configure=True)
|
||||
#res = resolver.Resolver(filename='/system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf', configure=True)
|
||||
else:
|
||||
res = resolver.Resolver(configure=True)
|
||||
#legge le impostazioni dalla configurazione e setta i relativi DNS
|
||||
if config.get_setting('resolver_dns_custom') and not config.get_setting('resolver_dns_service_choose'):
|
||||
res.nameservers = [config.get_setting('resolver_dns_custom1'),config.get_setting('resolver_dns_custom2')]
|
||||
else:
|
||||
nameservers_dns = config.get_setting('resolver_dns_service')
|
||||
# config.get_setting('resolver_dns_service_choose') == true
|
||||
if nameservers_dns == 1:# 'Google'
|
||||
res.nameservers = ['8.8.8.8', '2001:4860:4860::8888',
|
||||
'8.8.4.4', '2001:4860:4860::8844']
|
||||
@@ -39,6 +35,6 @@ if config.get_setting('resolver_dns'):
|
||||
res.nameservers = ['1.1.1.1', '2606:4700:4700::1111',
|
||||
'1.0.0.1', '2606:4700:4700::1001']
|
||||
# log di verifica dei DNS impostati, d'aiuto quando gli utenti smanettano...
|
||||
support.log("NAME SERVER2: {}".format(res.nameservers))
|
||||
support.log("NAME SERVER: {}".format(res.nameservers))
|
||||
|
||||
override_system_resolver(res)
|
||||
|
||||
+18
-42
@@ -1,44 +1,20 @@
|
||||
{
|
||||
"id": "search",
|
||||
"name": "@60672",
|
||||
"active": false,
|
||||
"adult": false,
|
||||
"language": ["ita"],
|
||||
"categories": ["movie"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "multithread",
|
||||
"type": "bool",
|
||||
"label": "@60673",
|
||||
"default": true,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "result_mode",
|
||||
"type": "list",
|
||||
"label": "@60674",
|
||||
"default": 0,
|
||||
"enabled": true,
|
||||
"visible": true,
|
||||
"lvalues": ["@60675","@60676"]
|
||||
},
|
||||
{
|
||||
"id": "saved_searches_limit",
|
||||
"type": "list",
|
||||
"label": "@60677",
|
||||
"default": 0,
|
||||
"enabled": true,
|
||||
"visible": true,
|
||||
"lvalues": ["10","20","30","40"]
|
||||
},
|
||||
{
|
||||
"id": "last_search",
|
||||
"type": "bool",
|
||||
"label": "@60678",
|
||||
"default": true,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
}
|
||||
]
|
||||
"id": "search",
|
||||
"name": "search",
|
||||
"active": false,
|
||||
"adult": false,
|
||||
"thumbnail": "",
|
||||
"banner": "",
|
||||
"categories": [],
|
||||
"settings": [
|
||||
{
|
||||
"id": "thread_number",
|
||||
"type": "list",
|
||||
"label": "@60673",
|
||||
"default": 0,
|
||||
"enabled": true,
|
||||
"visible": true,
|
||||
"lvalues": ["auto","1","2","4","6","8","16","24","32","64"]
|
||||
}
|
||||
]
|
||||
}
|
||||
+554
-639
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user