updater: periodo personalizzabile
This commit is contained in:
+14
-10
@@ -166,21 +166,25 @@ def check():
|
|||||||
return updated
|
return updated
|
||||||
|
|
||||||
|
|
||||||
def timer():
|
def timer(force=False):
|
||||||
import time
|
import time
|
||||||
curTime = time.time()
|
curTime = time.time()
|
||||||
file = "special://profile/addon_data/plugin.video.kod/updater_last_check.txt"
|
file = "special://profile/addon_data/plugin.video.kod/updater_last_check.txt"
|
||||||
period = 10
|
period = float(addon.getSetting('addon_update_timer')) * 3600
|
||||||
checked = False
|
if force:
|
||||||
try:
|
|
||||||
with open(xbmc.translatePath(file), 'r') as fileC:
|
|
||||||
lastCheck = float(fileC.read())
|
|
||||||
if curTime - lastCheck > period:
|
|
||||||
check()
|
|
||||||
checked = True
|
|
||||||
except:
|
|
||||||
check()
|
check()
|
||||||
checked = True
|
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:
|
if checked:
|
||||||
with open(xbmc.translatePath(file), 'w') as fileC:
|
with open(xbmc.translatePath(file), 'w') as fileC:
|
||||||
fileC.write(str(curTime))
|
fileC.write(str(curTime))
|
||||||
|
|||||||
@@ -5035,7 +5035,7 @@ msgid "To avoid waiting too long when a server does not respond:"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgctxt "#70579"
|
msgctxt "#70579"
|
||||||
msgid "Settings of urgent updates of KOD modules (Quick Fixes):"
|
msgid "Settings of KoD updates:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgctxt "#70580"
|
msgctxt "#70580"
|
||||||
@@ -5043,11 +5043,11 @@ msgid "Timeout (maximum waiting time)"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgctxt "#70581"
|
msgctxt "#70581"
|
||||||
msgid "Check for updates when kodi starts"
|
msgid "Check for updates"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgctxt "#70582"
|
msgctxt "#70582"
|
||||||
msgid "Do you want to see messages about the updates?"
|
msgid "Do you want to be notified?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgctxt "#70583"
|
msgctxt "#70583"
|
||||||
@@ -5765,4 +5765,7 @@ msgstr ""
|
|||||||
msgctxt "#707415"
|
msgctxt "#707415"
|
||||||
msgid "You have not selected any choice, the cloudflare DNS will be used."
|
msgid "You have not selected any choice, the cloudflare DNS will be used."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
# end DNS
|
|
||||||
|
msgctxt "#707416"
|
||||||
|
msgid "how often you want to check for updates? (hours)"
|
||||||
|
msgstr ""
|
||||||
|
|||||||
@@ -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:"
|
msgstr "Per evitare di aspettare troppo a lungo quando un server non risponde:"
|
||||||
|
|
||||||
msgctxt "#70579"
|
msgctxt "#70579"
|
||||||
msgid "Settings of urgent updates of KOD modules (Quick Fixes):"
|
msgid "Settings of KoD updates:"
|
||||||
msgstr "Impostazioni per gli aggiornamenti urgenti dei moduli di KOD (Quick Fixes)"
|
msgstr "Impostazioni degli aggiornamenti di KoD"
|
||||||
|
|
||||||
msgctxt "#70580"
|
msgctxt "#70580"
|
||||||
msgid "Timeout (maximum waiting time)"
|
msgid "Timeout (maximum waiting time)"
|
||||||
msgstr "Timeout (tempo massimo da aspettare)"
|
msgstr "Timeout (tempo massimo da aspettare)"
|
||||||
|
|
||||||
msgctxt "#70581"
|
msgctxt "#70581"
|
||||||
msgid "Check for updates when kodi starts"
|
msgid "Check for updates"
|
||||||
msgstr "Controlla gli aggiornamenti all'apertura di kodi"
|
msgstr "Controlla gli aggiornamenti"
|
||||||
|
|
||||||
msgctxt "#70582"
|
msgctxt "#70582"
|
||||||
msgid "Do you want to see messages about the updates?"
|
msgid "Do you want to be notified?"
|
||||||
msgstr "Voi ricevere dei messaggi per quanto riguarda gli aggiornamenti?"
|
msgstr "Voi essere notificato?"
|
||||||
|
|
||||||
msgctxt "#70583"
|
msgctxt "#70583"
|
||||||
msgid "Management of updates of other addons related to KOD:"
|
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."
|
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."
|
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)"
|
||||||
|
|||||||
@@ -170,6 +170,7 @@
|
|||||||
<setting label="70579" type="lsep"/>
|
<setting label="70579" type="lsep"/>
|
||||||
<setting id="addon_update_enabled" type="bool" label="70581" default="true"/>
|
<setting id="addon_update_enabled" type="bool" label="70581" default="true"/>
|
||||||
<setting id="addon_update_message" type="bool" label="70582" default="true"/>
|
<setting id="addon_update_message" type="bool" label="70582" default="true"/>
|
||||||
|
<setting id="addon_update_timer" type="labelenum" values="0.5|1|2|4|8|24" label="707416" default="1"/>
|
||||||
|
|
||||||
<setting label="Lista activa" type="text" id="lista_activa" default="kodfavorites-default.json" visible="false"/>
|
<setting label="Lista activa" type="text" id="lista_activa" default="kodfavorites-default.json" visible="false"/>
|
||||||
|
|
||||||
|
|||||||
+5
-6
@@ -311,11 +311,10 @@ def submenu_tools(item):
|
|||||||
itemlist.append(Item(channel='custom', action='mainlist', title='Custom Channel'))
|
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,
|
||||||
#itemlist.append(Item(channel=CHANNELNAME, action="check_quickfixes", folder=False,
|
title=config.get_localized_string(30001), plot=config.get_addon_version(with_fix=True) ))
|
||||||
# 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,
|
||||||
itemlist.append(Item(channel=CHANNELNAME, action="update_quasar", folder=False,
|
# title=config.get_localized_string(70569)))
|
||||||
title=config.get_localized_string(70569)))
|
|
||||||
itemlist.append(Item(channel=CHANNELNAME, action="", title="", folder=False,
|
itemlist.append(Item(channel=CHANNELNAME, action="", title="", folder=False,
|
||||||
thumbnail=get_thumb("setting_0.png")))
|
thumbnail=get_thumb("setting_0.png")))
|
||||||
|
|
||||||
@@ -344,7 +343,7 @@ def check_quickfixes(item):
|
|||||||
|
|
||||||
if not config.dev_mode():
|
if not config.dev_mode():
|
||||||
from platformcode import updater
|
from platformcode import updater
|
||||||
return updater.check()
|
return updater.timer(True)
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ if __name__ == "__main__":
|
|||||||
# Verificar quick-fixes al abrirse Kodi, y dejarlo corriendo como Thread
|
# Verificar quick-fixes al abrirse Kodi, y dejarlo corriendo como Thread
|
||||||
if not config.dev_mode():
|
if not config.dev_mode():
|
||||||
from platformcode import updater
|
from platformcode import updater
|
||||||
updater.check()
|
updater.timer(True)
|
||||||
|
|
||||||
# Copia Custom code a las carpetas de Alfa desde la zona de Userdata
|
# Copia Custom code a las carpetas de Alfa desde la zona de Userdata
|
||||||
from platformcode import custom_code
|
from platformcode import custom_code
|
||||||
|
|||||||
Reference in New Issue
Block a user