# Path: resources/lib/common/logger.py
# def debug(text):
#     xbmc.log('[{}] {}'.format(APP, text), xbmc.LOGDEBUG)
# 
# Path: resources/lib/constants.py
# ADDON_ID = 'plugin.video.stream-cinema'
# 
# Path: resources/lib/kodiutils.py
# def get_setting(key):
#     return addon.getSetting(key)


from resources.lib.common.logger import debug
from resources.lib.constants import ADDON_ID
from resources.lib.kodiutils import get_setting
import xbmcaddon
import xbmc


class Settings(xbmc.Monitor):
    addon = None

    def __init__(self):
        self.refresh()
        pass

    def onSettingsChanged(self):
        self.refresh()

    def refresh(self):
        debug('settings refresh')
        self.refresh_addon()
        pass

    def refresh_addon(self):
        self.addon = xbmcaddon.Addon(ADDON_ID)

    def get_setting(self, key):
        return xbmcaddon.Addon(ADDON_ID).getSetting(key)

    def set_setting(self, key, val):

# Path: resources/lib/common/logger.py
# def debug(text):
#     xbmc.log('[{}] {}'.format(APP, text), xbmc.LOGDEBUG)
# 
# Path: resources/lib/constants.py
# ADDON_ID = 'plugin.video.stream-cinema'
# 
# Path: resources/lib/kodiutils.py
# def get_setting(key):
#     return addon.getSetting(key)


# Path: resources/lib/services/Settings.py
from resources.lib.common.logger import debug
from resources.lib.constants import ADDON_ID
from resources.lib.kodiutils import get_setting
import xbmcaddon
import xbmc



class Settings(xbmc.Monitor):
    addon = None

    def __init__(self):
        self.refresh()
        pass

    def onSettingsChanged(self):
        self.refresh()

    def refresh(self):
        debug('settings refresh')
        self.refresh_addon()
        pass

    def refresh_addon(self):
        self.addon = xbmcaddon.Addon(ADDON_ID)

    def get_setting(self, key):
        return xbmcaddon.Addon(ADDON_ID).getSetting(key)

    def set_setting(self, key, val):

        debug('set_settings {} {}'.format(key, val))