updater: ricerca forzata dalle impostazioni

This commit is contained in:
marco
2020-01-04 14:15:13 +01:00
parent b2b7b1fedf
commit e4762e882b
4 changed files with 12 additions and 7 deletions
+7 -3
View File
@@ -160,6 +160,7 @@ def check():
xbmc.executebuiltin("UpdateLocalAddons")
if poFilesChanged:
refreshLang()
updated = True
else:
logger.info('Nessun nuovo aggiornamento')
@@ -171,8 +172,10 @@ def timer(force=False):
curTime = time.time()
file = "special://profile/addon_data/plugin.video.kod/updater_last_check.txt"
period = float(addon.getSetting('addon_update_timer')) * 3600
updated = False
if force:
check()
updated = check()
checked = True
else:
checked = False
@@ -180,14 +183,15 @@ def timer(force=False):
with open(xbmc.translatePath(file), 'r') as fileC:
lastCheck = float(fileC.read())
if curTime - lastCheck > period:
check()
updated = check()
checked = True
except:
check()
updated = check()
checked = True
if checked:
with open(xbmc.translatePath(file), 'w') as fileC:
fileC.write(str(curTime))
return updated
+1 -1
View File
@@ -5398,7 +5398,7 @@ msgid "Use the context menu to define one"
msgstr ""
msgctxt "#70667"
msgid "Alpha is already updated"
msgid "KoD is already updated"
msgstr ""
msgctxt "#70668"
+2 -2
View File
@@ -5398,8 +5398,8 @@ msgid "Use the context menu to define one"
msgstr "Usa il menù contestuale per aggiungerne una"
msgctxt "#70667"
msgid "Alpha is already updated"
msgstr "Alpha è già aggiornato"
msgid "KoD is already updated"
msgstr "KoD è già aggiornato"
msgctxt "#70668"
msgid "There is no urgent update"
+2 -1
View File
@@ -343,7 +343,8 @@ def check_quickfixes(item):
if not config.dev_mode():
from platformcode import updater
return updater.timer(True)
if not updater.timer(True):
platformtools.dialog_ok('Kodi on Demand', config.get_localized_string(70667))
else:
return False