Exemplo n.º 1
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:
        import xbmc
        print 'OpenScrapers Addon Data Path Does not Exist. Creating Folder....'
        ad_folder = xbmc.translatePath(
            'special://home/userdata/addon_data/script.module.openscrapers')
        os.makedirs(ad_folder)

    try:
        with open(versionFile, 'rb') as fh:
            oldVersion = fh.read()
    except:
        oldVersion = '0'

    try:
        curVersion = control.addon('script.module.openscrapers').getAddonInfo(
            'version')
        if oldVersion != curVersion:
            with open(versionFile, 'wb') as fh:
                fh.write(curVersion)
            return True
        else:
            return False
    except:
        return False
Exemplo n.º 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