Example #1
0
def addView(content):
    try:
        skin = control.skin
        record = (skin, content, str(control.getCurrentViewId()))
        control.makeFile(control.dataPath)
        dbcon = database.connect(control.viewsFile)
        dbcur = dbcon.cursor()
        dbcur.execute("CREATE TABLE IF NOT EXISTS views"
                      " ("
                      "skin TEXT, "
                      "view_type TEXT, "
                      "view_id TEXT, "
                      "UNIQUE(skin, view_type)"
                      ");")
        dbcur.execute("DELETE FROM views WHERE skin = ? AND view_type = ?", (
            record[0],
            record[1],
        ))
        dbcur.execute("INSERT INTO views Values (?, ?, ?)", record)
        dbcon.commit()

        viewName = control.infoLabel('Container.Viewmode')
        skinName = control.addon(skin).getAddonInfo('name')
        skinIcon = control.addon(skin).getAddonInfo('icon')

        control.infoDialog(viewName, heading=skinName, icon=skinIcon)
    except:
        return
Example #2
0
def getTraktAddonEpisodeInfo():
    try: scrobble = control.addon('script.trakt').getSetting('scrobble_episode')
    except: scrobble = ''
    try: ExcludeHTTP = control.addon('script.trakt').getSetting('ExcludeHTTP')
    except: ExcludeHTTP = ''
    try: authorization = control.addon('script.trakt').getSetting('authorization')
    except: authorization = ''
    if scrobble == 'true' and ExcludeHTTP == 'false' and not authorization == '': return True
    else: return False
Example #3
0
def _find_cache_version():

    import os

    versionFile = os.path.join(control.dataPath, 'cache.v')
    try:
        if not os.path.exists(versionFile):
            f = open(versionFile, 'w')
            f.close()
    except Exception as e:
        import xbmc
        print 'Wraith Addon Data Path Does not Exist. Creating Folder....'
        ad_folder = xbmc.translatePath(
            'special://home/userdata/addon_data/script.extendedinfo')
        os.makedirs(ad_folder)

    try:
        with open(versionFile, 'rb') as fh:
            oldVersion = fh.read()
    except:
        oldVersion = '0'
    try:
        curVersion = control.addon('script.extendedinfo').getAddonInfo(
            'version')
        if oldVersion != curVersion:
            with open(versionFile, 'wb') as fh:
                fh.write(curVersion)
            return True
        else:
            return False
    except:
        return False
Example #4
0
def _find_cache_version():
    import os

    versionFile = os.path.join(control.dataPath, 'cache.v')
    try:
        with open(versionFile, 'rb') as fh:
            oldVersion = fh.read()
    except:
        oldVersion = '0'
    try:
        curVersion = control.addon('script.module.exodusredux').getAddonInfo(
            'version')
        if oldVersion != curVersion:
            with open(versionFile, 'wb') as fh:
                fh.write(curVersion)
            return True
        else:
            return False
    except:
        return False
Example #5
0
def _find_cache_versionAlt(
):  # Added to keep track of plugin.video.exodusredux version

    import os
    versionFile = os.path.join(control.dataPath, 'cache.v2')
    try:
        with open(versionFile, 'rb') as fh:
            oldVersion = fh.read()
    except:
        oldVersion = '0'
    try:
        curVersion = control.addon('plugin.video.exodusredux').getAddonInfo(
            'version')
        if oldVersion != curVersion:
            with open(versionFile, 'wb') as fh:
                fh.write(curVersion)
            return True
        else:
            return False
    except:
        return False