diff --git a/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py b/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py index fe39cad1e..87a93e2e6 100644 --- a/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py +++ b/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py @@ -30,7 +30,7 @@ class AbstractSettings(object): _echo = False _cache = {} _check_set = True - _type = None + _instance = None @classmethod def flush(cls, xbmc_addon): diff --git a/resources/lib/youtube_plugin/kodion/settings/xbmc/xbmc_plugin_settings.py b/resources/lib/youtube_plugin/kodion/settings/xbmc/xbmc_plugin_settings.py index 1145f95a1..ac6f0b2e3 100644 --- a/resources/lib/youtube_plugin/kodion/settings/xbmc/xbmc_plugin_settings.py +++ b/resources/lib/youtube_plugin/kodion/settings/xbmc/xbmc_plugin_settings.py @@ -69,9 +69,9 @@ def flush(cls, xbmc_addon): cls._echo = get_kodi_setting_bool('debug.showloginfo') cls._cache = {} if current_system_version.compatible(21, 0): - cls._type = xbmc_addon.getSettings + cls._instance = xbmc_addon.getSettings() else: - cls._type = xbmcaddon.Addon + cls._instance = xbmcaddon.Addon() def get_bool(self, setting, default=None, echo=None): if setting in self._cache: @@ -79,7 +79,7 @@ def get_bool(self, setting, default=None, echo=None): error = False try: - value = bool(self._get_bool(self._type(), setting)) + value = bool(self._get_bool(self._instance, setting)) except (TypeError, ValueError) as exc: error = exc try: @@ -103,7 +103,7 @@ def get_bool(self, setting, default=None, echo=None): def set_bool(self, setting, value, echo=None): try: - error = not self._set_bool(self._type(), setting, value) + error = not self._set_bool(self._instance, setting, value) if error and self._check_set: error = 'failed' else: @@ -126,7 +126,7 @@ def get_int(self, setting, default=-1, process=None, echo=None): error = False try: - value = int(self._get_int(self._type(), setting)) + value = int(self._get_int(self._instance, setting)) if process: value = process(value) except (TypeError, ValueError) as exc: @@ -152,7 +152,7 @@ def get_int(self, setting, default=-1, process=None, echo=None): def set_int(self, setting, value, echo=None): try: - error = not self._set_int(self._type(), setting, value) + error = not self._set_int(self._instance, setting, value) if error and self._check_set: error = 'failed' else: @@ -175,7 +175,7 @@ def get_string(self, setting, default='', echo=None): error = False try: - value = self._get_str(self._type(), setting) or default + value = self._get_str(self._instance, setting) or default except (RuntimeError, TypeError) as exc: error = exc value = default @@ -199,7 +199,7 @@ def get_string(self, setting, default='', echo=None): def set_string(self, setting, value, echo=None): try: - error = not self._set_str(self._type(), setting, value) + error = not self._set_str(self._instance, setting, value) if error and self._check_set: error = 'failed' else: @@ -230,7 +230,7 @@ def get_string_list(self, setting, default=None, echo=None): error = False try: - value = self._get_str_list(self._type(), setting) + value = self._get_str_list(self._instance, setting) if not value: value = [] if default is None else default except (RuntimeError, TypeError) as exc: @@ -248,7 +248,7 @@ def get_string_list(self, setting, default=None, echo=None): def set_string_list(self, setting, value, echo=None): try: - error = not self._set_str_list(self._type(), setting, value) + error = not self._set_str_list(self._instance, setting, value) if error and self._check_set: error = 'failed' else: