fix e migliorie updater

This commit is contained in:
marco
2020-01-21 22:43:54 +01:00
parent db96e414b5
commit 88fba710c1
3 changed files with 18 additions and 5 deletions

View File

@@ -64,6 +64,7 @@ def check(background=False):
localCommitSha = localCommitSha.replace('\n', '') # da testare
logger.info('Commit locale: ' + localCommitSha)
updated = False
serviceChanged = False
pos = None
for n, c in enumerate(commits):
@@ -105,6 +106,8 @@ def check(background=False):
logger.info(file["filename"])
if 'resources/language' in file["filename"]:
poFilesChanged = True
if 'videolibrary_service.py' in file["filename"]:
serviceChanged = True
if file['status'] == 'modified' or file['status'] == 'added':
if 'patch' in file:
text = ""
@@ -173,7 +176,7 @@ def check(background=False):
else:
logger.info('Nessun nuovo aggiornamento')
return updated
return updated, serviceChanged
def showSavedChangelog():

View File

@@ -343,7 +343,7 @@ def check_quickfixes(item):
if not config.dev_mode():
from platformcode import updater
if not updater.check():
if not updater.check()[0]:
platformtools.dialog_ok('Kodi on Demand', config.get_localized_string(70667))
else:
return False

View File

@@ -310,11 +310,18 @@ def monitor_update():
if not config.dev_mode():
period = float(config.get_setting('addon_update_timer')) * 3600
curTime = time.time()
lastCheck = float(config.get_setting("updater_last_check", "videolibrary", '0'))
lastCheck = config.get_setting("updater_last_check", "videolibrary", '0')
if lastCheck:
lastCheck = float(lastCheck)
else:
lastCheck = 0
if curTime - lastCheck > period:
updater.check(background=True)
updated, needsReload = updater.check(background=True)
config.set_setting("updater_last_check", "videolibrary", str(curTime))
if needsReload:
xbmc.executescript(__file__)
exit(0)
# def get_channel_json():
# import urllib, os, xbmc
@@ -387,7 +394,10 @@ if __name__ == "__main__":
# Verificar quick-fixes al abrirse Kodi, y dejarlo corriendo como Thread
if not config.dev_mode():
updater.check()
updated, needsReload = updater.check()
if needsReload:
xbmc.executescript(__file__)
exit(0)
# Copia Custom code a las carpetas de Alfa desde la zona de Userdata
from platformcode import custom_code