diff --git a/resources/lib/functions.py b/resources/lib/functions.py index 31284e0..a4d95c1 100644 --- a/resources/lib/functions.py +++ b/resources/lib/functions.py @@ -125,7 +125,8 @@ def main_entry_point(): elif mode == "CLONE_SKIN": clone_default_skin() elif mode == "SHOW_SETTINGS": - __addon__.openSettings() + addon = xbmcaddon.Addon() + addon.openSettings() window = xbmcgui.getCurrentWindowId() if window == 10000: log.debug( diff --git a/resources/lib/kodi_utils.py b/resources/lib/kodi_utils.py index a7553f1..b2be06d 100644 --- a/resources/lib/kodi_utils.py +++ b/resources/lib/kodi_utils.py @@ -11,11 +11,6 @@ import xbmcaddon from .lazylogger import LazyLogger log = LazyLogger(__name__) -try: - addon = xbmcaddon.Addon() -except Exception: - # During installation/update, addon might not be fully registered yet - addon = None class HomeWindow: @@ -45,6 +40,7 @@ def add_menu_directory_item(label, path, folder=True, art=None, properties=None) li = xbmcgui.ListItem(label, path=path, offscreen=True) if art is None: art = {} + addon = xbmcaddon.Addon() art["thumb"] = addon.getAddonInfo('icon') if properties is not None: li.setProperties(properties)