Properly fix intermittent installation failures
Some checks failed
Build JellyCon / build (py2) (push) Has been cancelled
Build JellyCon / build (py3) (push) Has been cancelled
CodeQL Analysis / analyze (python, 3.9) (push) Has been cancelled
Release Drafter / Update release draft (push) Has been cancelled
Test JellyCon / test (3.9) (push) Has been cancelled

Instead of setting addon variables to None (which causes issues),
fix the root cause by removing unnecessary module-level initialization:

- Remove module-level user_details loading in functions.py
- Load user_details locally in functions where actually needed
- Wrap remaining module-level addon access in try/except in:
  - service.py (log_timing_data)
  - default.py (log_timing_data)
  - kodi_utils.py (addon variable)
  - functions.py (__addon__ and related variables)

This prevents crashes during installation/update while avoiding
None-related issues during normal operation.
This commit is contained in:
mani
2026-01-06 01:12:59 +01:00
parent 1879a8ed01
commit a71efe14c1
7 changed files with 1984 additions and 18 deletions

View File

@@ -8,10 +8,14 @@ from resources.lib.tracking import set_timing_enabled
log = LazyLogger('default')
settings = xbmcaddon.Addon()
log_timing_data = settings.getSetting('log_timing') == "true"
if log_timing_data:
set_timing_enabled(True)
try:
settings = xbmcaddon.Addon()
log_timing_data = settings.getSetting('log_timing') == "true"
if log_timing_data:
set_timing_enabled(True)
except Exception:
# During installation/update, addon might not be fully registered yet
pass
log.debug("About to enter mainEntryPoint()")