verifica directory e test_conn spostati in service

This commit is contained in:
mac12m99
2021-02-28 20:23:57 +01:00
parent 503fe75d26
commit ec8ab9db35
4 changed files with 12 additions and 14 deletions

View File

@@ -20,22 +20,12 @@ def start():
functions that we want to execute as soon as we open the plugin.
"""
logger.debug()
# config.set_setting('show_once', True)
# Test if all the required directories are created
config.verify_directories_created()
# check if the user has any connection problems
# if it has: it does not enter the addon
# if it has DNS problems start but let in
# if everything is ok: enter the addon
from platformcode.checkhost import test_conn
import threading
threading.Thread(target=test_conn, args=(True, not config.get_setting('resolver_dns'), True, [], [], True)).start()
if not config.dev_mode():
from platformcode import updater
updater.showSavedChangelog()
def run(item=None):
# from core.support import dbg;dbg()
logger.debug()

View File

@@ -6149,7 +6149,7 @@ msgid "Notice Activation"
msgstr ""
msgctxt "#707406"
msgid "By disabling the alert, you have activated a notice\nthat will appear at the top right in case of problems"
msgid "By disabling the alert, you have activated a notice\nthat will appear at the top right"
msgstr ""
msgctxt "#707407"

View File

@@ -6150,8 +6150,8 @@ msgid "Notice Activation"
msgstr "Attivazione Notifica"
msgctxt "#707406"
msgid "By disabling the alert, you have activated a notice\nthat will appear at the top right in case of problems"
msgstr "Disattivando l'avviso, hai attivato una notifica\nche apparirà in alto a dx in caso di problemi"
msgid "By disabling the alert, you have activated a notice\nthat will appear at the top right"
msgstr "Disattivando l'avviso, hai attivato una notifica\nche apparirà in alto a dx"
msgctxt "#707407"
msgid "For any change to the DNS you MUST restart Kodi!"

View File

@@ -448,6 +448,10 @@ class AddonMonitor(xbmc.Monitor):
if __name__ == "__main__":
logger.info('Starting KoD service')
# Test if all the required directories are created
config.verify_directories_created()
if config.get_setting('autostart'):
xbmc.executebuiltin('RunAddon(plugin.video.' + config.PLUGIN_NAME + ')')
@@ -508,6 +512,10 @@ if __name__ == "__main__":
while xbmc.getCondVisibility('Library.IsScanningVideo()'):
xbmc.sleep(1000)
# check if the user has any connection problems
from platformcode.checkhost import test_conn
run_threaded(test_conn, (True, not config.get_setting('resolver_dns'), True, [], [], True))
monitor = AddonMonitor()
# mark as stopped all downloads (if we are here, probably kodi just started)