Merge branch 'master' of https://github.com/kodiondemand/addon
This commit is contained in:
@@ -90,7 +90,7 @@ def check_addon_init():
|
||||
localCommitFile.close()
|
||||
c['sha'] = updateFromZip('Aggiornamento in corso...')
|
||||
localCommitFile = open(addonDir + trackingFile, 'w') # il file di tracking viene eliminato, lo ricreo
|
||||
changelog += commitJson['commit']['message'] + " | "
|
||||
changelog += commitJson['commit']['message'] + "\n"
|
||||
nCommitApplied += 3 # il messaggio sarà lungo, probabilmente, il tempo di vis. è maggiorato
|
||||
break
|
||||
|
||||
@@ -145,11 +145,10 @@ def check_addon_init():
|
||||
filetools.move(addonDir + file['previous_filename'], addonDir + file['filename'])
|
||||
alreadyApplied = False
|
||||
if not alreadyApplied: # non mando notifica se già applicata (es. scaricato zip da github)
|
||||
changelog += commitJson['commit']['message'] + " | "
|
||||
changelog += commitJson['commit']['message'] + "\n"
|
||||
nCommitApplied += 1
|
||||
if addon.getSetting("addon_update_message"):
|
||||
time = nCommitApplied * 2000 if nCommitApplied < 10 else 20000
|
||||
platformtools.dialog_notification('Kodi on Demand', 'Aggiornamenti applicati:\n' + changelog[:-3], time)
|
||||
platformtools.dialog_ok('Kodi on Demand', 'Aggiornamenti applicati:\n' + changelog)
|
||||
|
||||
localCommitFile.seek(0)
|
||||
localCommitFile.truncate()
|
||||
|
||||
@@ -2,29 +2,20 @@
|
||||
# -*- 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'):
|
||||
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
|
||||
from core import support
|
||||
|
||||
res = dns.resolver.Resolver(configure=True)
|
||||
|
||||
"""
|
||||
legge le impostazioni dalla configurazione
|
||||
e setta i relativi DNS
|
||||
"""
|
||||
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 +30,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)
|
||||
|
||||
@@ -158,9 +158,10 @@ def channel_search(item):
|
||||
results = list()
|
||||
valid = list()
|
||||
ch_list = dict()
|
||||
to_temp = dict()
|
||||
mode = item.mode
|
||||
max_results = 10
|
||||
if item.infoLabels['title']:
|
||||
item.text = item.infoLabels['title']
|
||||
|
||||
searched_id = item.infoLabels['tmdb_id']
|
||||
|
||||
@@ -169,15 +170,16 @@ def channel_search(item):
|
||||
from lib import cloudscraper
|
||||
session = cloudscraper.create_scraper()
|
||||
|
||||
searching += channel_list
|
||||
searching += [ch[0] for ch in channel_list]
|
||||
searching_titles = [ch[1] for ch in channel_list]
|
||||
cnt = 0
|
||||
|
||||
progress = platformtools.dialog_progress(config.get_localized_string(30993) % item.title, config.get_localized_string(70744) % len(channel_list),
|
||||
str(searching))
|
||||
str(searching_titles))
|
||||
config.set_setting('tmdb_active', False)
|
||||
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
c_results = [executor.submit(get_channel_results, ch, item, session) for ch in channel_list]
|
||||
c_results = [executor.submit(get_channel_results, ch[0], item, session) for ch in channel_list]
|
||||
|
||||
for res in futures.as_completed(c_results):
|
||||
cnt += 1
|
||||
@@ -188,9 +190,10 @@ def channel_search(item):
|
||||
if progress.iscanceled():
|
||||
break
|
||||
if finished in searching:
|
||||
searching_titles.remove(searching_titles[searching.index(finished)])
|
||||
searching.remove(finished)
|
||||
progress.update((cnt * 100) / len(channel_list), config.get_localized_string(70744) % str(len(channel_list) - cnt),
|
||||
str(searching))
|
||||
str(searching_titles))
|
||||
|
||||
progress.close()
|
||||
|
||||
@@ -201,8 +204,12 @@ def channel_search(item):
|
||||
config.set_setting('tmdb_active', True)
|
||||
res_count = 0
|
||||
for key, value in ch_list.items():
|
||||
ch_path = filetools.join(config.get_runtime_path(),'channels',key+'.json')
|
||||
ch_name = jsontools.load(filetools.read(ch_path))['name']
|
||||
for ch in channel_list:
|
||||
if ch[0] == key:
|
||||
ch_name = ch[1]
|
||||
break
|
||||
else:
|
||||
ch_name = key
|
||||
grouped = list()
|
||||
cnt += 1
|
||||
progress.update((cnt * 100) / len(ch_list), config.get_localized_string(60295), config.get_localized_string(60293))
|
||||
@@ -326,7 +333,7 @@ def get_channels(item):
|
||||
|
||||
if item.mode == 'all' or (item.mode in list_cat):
|
||||
if config.get_setting("include_in_global_search", channel):
|
||||
channels_list.append(channel)
|
||||
channels_list.append((channel, ch_param.get('title', channel)))
|
||||
|
||||
return channels_list
|
||||
|
||||
|
||||
Reference in New Issue
Block a user