diff --git a/platformcode/updater.py b/platformcode/updater.py index 2db5acdd..0c731167 100644 --- a/platformcode/updater.py +++ b/platformcode/updater.py @@ -166,21 +166,25 @@ def check(): return updated -def timer(): +def timer(force=False): import time curTime = time.time() file = "special://profile/addon_data/plugin.video.kod/updater_last_check.txt" - period = 10 - checked = False - try: - with open(xbmc.translatePath(file), 'r') as fileC: - lastCheck = float(fileC.read()) - if curTime - lastCheck > period: - check() - checked = True - except: + period = float(addon.getSetting('addon_update_timer')) * 3600 + if force: check() checked = True + else: + checked = False + try: + with open(xbmc.translatePath(file), 'r') as fileC: + lastCheck = float(fileC.read()) + if curTime - lastCheck > period: + check() + checked = True + except: + check() + checked = True if checked: with open(xbmc.translatePath(file), 'w') as fileC: fileC.write(str(curTime)) diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index 3c9a4a96..e77a07cc 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -5035,7 +5035,7 @@ msgid "To avoid waiting too long when a server does not respond:" msgstr "" msgctxt "#70579" -msgid "Settings of urgent updates of KOD modules (Quick Fixes):" +msgid "Settings of KoD updates:" msgstr "" msgctxt "#70580" @@ -5043,11 +5043,11 @@ msgid "Timeout (maximum waiting time)" msgstr "" msgctxt "#70581" -msgid "Check for updates when kodi starts" +msgid "Check for updates" msgstr "" msgctxt "#70582" -msgid "Do you want to see messages about the updates?" +msgid "Do you want to be notified?" msgstr "" msgctxt "#70583" @@ -5765,4 +5765,7 @@ msgstr "" msgctxt "#707415" msgid "You have not selected any choice, the cloudflare DNS will be used." msgstr "" -# end DNS + +msgctxt "#707416" +msgid "how often you want to check for updates? (hours)" +msgstr "" diff --git a/resources/language/Italian/strings.po b/resources/language/Italian/strings.po index 18fb8d7e..73278c73 100644 --- a/resources/language/Italian/strings.po +++ b/resources/language/Italian/strings.po @@ -5034,20 +5034,20 @@ msgid "To avoid waiting too long when a server does not respond:" msgstr "Per evitare di aspettare troppo a lungo quando un server non risponde:" msgctxt "#70579" -msgid "Settings of urgent updates of KOD modules (Quick Fixes):" -msgstr "Impostazioni per gli aggiornamenti urgenti dei moduli di KOD (Quick Fixes)" +msgid "Settings of KoD updates:" +msgstr "Impostazioni degli aggiornamenti di KoD" msgctxt "#70580" msgid "Timeout (maximum waiting time)" msgstr "Timeout (tempo massimo da aspettare)" msgctxt "#70581" -msgid "Check for updates when kodi starts" -msgstr "Controlla gli aggiornamenti all'apertura di kodi" +msgid "Check for updates" +msgstr "Controlla gli aggiornamenti" msgctxt "#70582" -msgid "Do you want to see messages about the updates?" -msgstr "Voi ricevere dei messaggi per quanto riguarda gli aggiornamenti?" +msgid "Do you want to be notified?" +msgstr "Voi essere notificato?" msgctxt "#70583" msgid "Management of updates of other addons related to KOD:" @@ -5770,4 +5770,6 @@ msgctxt "#707415" msgid "You have not selected any choice, the cloudflare DNS will be used." msgstr "Non hai selezionato nessuna scelta!\nVerranno utilizzati i DNS di cloudflare." -# end DNS +msgctxt "#707416" +msgid "how often you want to check for updates? (hours)" +msgstr "Ogni quanto vuoi che vengano controllati? (ore)" diff --git a/resources/settings.xml b/resources/settings.xml index 3eb677a6..5b2adf9e 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -170,6 +170,7 @@ + diff --git a/specials/setting.py b/specials/setting.py index 4e8121fd..bff6fa4f 100644 --- a/specials/setting.py +++ b/specials/setting.py @@ -311,11 +311,10 @@ def submenu_tools(item): itemlist.append(Item(channel='custom', action='mainlist', title='Custom Channel')) - #Disabilitato il menu degli aggiornamenti - #itemlist.append(Item(channel=CHANNELNAME, action="check_quickfixes", folder=False, - # title=config.get_localized_string(30001), plot="Versión actual: %s" % config.get_addon_version() )) - itemlist.append(Item(channel=CHANNELNAME, action="update_quasar", folder=False, - title=config.get_localized_string(70569))) + itemlist.append(Item(channel=CHANNELNAME, action="check_quickfixes", folder=False, + title=config.get_localized_string(30001), plot=config.get_addon_version(with_fix=True) )) + # itemlist.append(Item(channel=CHANNELNAME, action="update_quasar", folder=False, + # title=config.get_localized_string(70569))) itemlist.append(Item(channel=CHANNELNAME, action="", title="", folder=False, thumbnail=get_thumb("setting_0.png"))) @@ -344,7 +343,7 @@ def check_quickfixes(item): if not config.dev_mode(): from platformcode import updater - return updater.check() + return updater.timer(True) else: return False diff --git a/videolibrary_service.py b/videolibrary_service.py index 556948ef..8efd3df2 100644 --- a/videolibrary_service.py +++ b/videolibrary_service.py @@ -378,7 +378,7 @@ if __name__ == "__main__": # Verificar quick-fixes al abrirse Kodi, y dejarlo corriendo como Thread if not config.dev_mode(): from platformcode import updater - updater.check() + updater.timer(True) # Copia Custom code a las carpetas de Alfa desde la zona de Userdata from platformcode import custom_code