# Path: lib/libs/addonsettings.py
# DEFAULT_IMAGESIZE = '1'
# AVAILABLE_IMAGESIZES = {'0': (10000, 10000, 600), '1': (1920, 1080, 600), '2': (1280, 720, 480)}
# PROGRESS_DISPLAY_FULLPROGRESS = '0'
# PROGRESS_DISPLAY_WARNINGSERRORS = '1'
# PROGRESS_DISPLAY_NONE = '2' # Only add-on crashes
# EXCLUSION_PATH_TYPE_FOLDER = '0'
# EXCLUSION_PATH_TYPE_PREFIX = '1'
# EXCLUSION_PATH_TYPE_REGEX = '2'
# class Settings(object):
#     def __init__(self):
#     def update_useragent(self):
#     def update_settings(self):
#     def get_apikey(self, provider):
#     def get_apienabled(self, provider):
#     def get_api_config(self, provider):
#     def autoadd_episodes(self):
#     def autoadd_episodes(self, value):
# def get_projectkey(provider):


import sqlite3
import xbmc
import xbmcvfs
from lib.libs.addonsettings import settings
    def does_not_exist(self, mediaid, mediatype, medialabel):
        return not self.exists(mediaid, mediatype, medialabel)

    def _key_exists(self, mediaid, mediatype):
        return bool(self.db.fetchone("SELECT * FROM processeditems WHERE mediaid=? AND mediatype=?",
            (mediaid, mediatype)))

def upgrade_processeditems(db, fromversion):
    if fromversion == VERSION:
        return VERSION

    if fromversion == -1:
        # new install, build the database fresh
        db.execute("""CREATE TABLE processeditems (mediaid INTEGER NOT NULL, mediatype TEXT NOT NULL,
            medialabel TEXT, nextdate DATETIME, data TEXT, PRIMARY KEY (mediaid, mediatype))""")
        return VERSION

    workingversion = fromversion
    if workingversion == 0:
        db.execute("""ALTER TABLE processeditems ADD COLUMN medialabel TEXT""")
        workingversion = 1

    return workingversion

SETTINGS_TABLE_VALUE = 'database-settings'
# must be quoted to use as identifier
SETTINGS_TABLE = '"{0}"'.format(SETTINGS_TABLE_VALUE)

class Database(object):
    def __init__(self, databasename, upgrade_fn):

# Path: lib/libs/addonsettings.py
# DEFAULT_IMAGESIZE = '1'
# AVAILABLE_IMAGESIZES = {'0': (10000, 10000, 600), '1': (1920, 1080, 600), '2': (1280, 720, 480)}
# PROGRESS_DISPLAY_FULLPROGRESS = '0'
# PROGRESS_DISPLAY_WARNINGSERRORS = '1'
# PROGRESS_DISPLAY_NONE = '2' # Only add-on crashes
# EXCLUSION_PATH_TYPE_FOLDER = '0'
# EXCLUSION_PATH_TYPE_PREFIX = '1'
# EXCLUSION_PATH_TYPE_REGEX = '2'
# class Settings(object):
#     def __init__(self):
#     def update_useragent(self):
#     def update_settings(self):
#     def get_apikey(self, provider):
#     def get_apienabled(self, provider):
#     def get_api_config(self, provider):
#     def autoadd_episodes(self):
#     def autoadd_episodes(self, value):
# def get_projectkey(provider):


# Path: lib/libs/processeditems.py
import sqlite3
import xbmc
import xbmcvfs
from lib.libs.addonsettings import settings

    def does_not_exist(self, mediaid, mediatype, medialabel):
        return not self.exists(mediaid, mediatype, medialabel)

    def _key_exists(self, mediaid, mediatype):
        return bool(self.db.fetchone("SELECT * FROM processeditems WHERE mediaid=? AND mediatype=?",
            (mediaid, mediatype)))

def upgrade_processeditems(db, fromversion):
    if fromversion == VERSION:
        return VERSION

    if fromversion == -1:
        # new install, build the database fresh
        db.execute("""CREATE TABLE processeditems (mediaid INTEGER NOT NULL, mediatype TEXT NOT NULL,
            medialabel TEXT, nextdate DATETIME, data TEXT, PRIMARY KEY (mediaid, mediatype))""")
        return VERSION

    workingversion = fromversion
    if workingversion == 0:
        db.execute("""ALTER TABLE processeditems ADD COLUMN medialabel TEXT""")
        workingversion = 1

    return workingversion

SETTINGS_TABLE_VALUE = 'database-settings'
# must be quoted to use as identifier
SETTINGS_TABLE = '"{0}"'.format(SETTINGS_TABLE_VALUE)

class Database(object):
    def __init__(self, databasename, upgrade_fn):

        dbpath = settings.datapath