コード例 #1
0
    elif 'amazonRating' in title:
        stars = float(title['amazonRating']['rating']
                      ) * 2 if 'rating' in title['amazonRating'] else None
        votes = title['amazonRating']['count'] if 'count' in title[
            'amazonRating'] else None

    if 'images' in title['formats'][0].keys():
        try:
            thumbnailUrl = title['formats'][0]['images'][0]['uri']
            thumbnailFilename = thumbnailUrl.split('/')[-1]
            thumbnailBase = thumbnailUrl.replace(thumbnailFilename, '')
            poster = thumbnailBase + thumbnailFilename.split('.')[0] + '.jpg'
        except:
            poster = None

    if 'bbl test' not in movietitle.lower(
    ) and 'test movie' not in movietitle.lower():
        moviedata = [
            cleanData(x) for x in [
                asin,
                checkCase(movietitle), trailer, poster, plot, director, None,
                runtime, year, premiered, studio, mpaa, actors, genres, stars,
                votes, fanart, isPrime, isHD, isAdult, None, None, audio
            ]
        ]
        titelnum += addMoviedb(moviedata)
    return titelnum


MovieDB = db.connSQL('movie')
コード例 #2
0
        imdbid = re.compile('/title/(.+?)/', re.DOTALL).findall(url)
    Log(imdbid + asins.split(',')[0])
    return imdbid


def setNewest(compList=False):
    Log('updating new seasons', xbmc.LOGDEBUG)
    if not compList:
        compList = getCategories()
    catList = compList['tv_shows']
    db.waitforDB(tvDB)
    c = tvDB.cursor()
    db.cur_exec(c, 'drop table if exists categories')
    db.cur_exec(c, 'create table categories(title TEXT, asins TEXT)')
    db.cur_exec(c, 'update seasons set recent=null')
    count = 1
    for catid in catList:
        if catid == 'PrimeTVRecentlyAdded':
            for asin in catList[catid]:
                seasonasin = lookupTVdb(asin, rvalue='seasonasin')
                if not seasonasin:
                    seasonasin = asin

                db.cur_exec(c, "update seasons set recent=? where asin like (?)", (count, '%' + seasonasin + '%'))
                count += 1
        else:
            db.cur_exec(c, 'insert ignore into categories values (?,?)', [catid, catList[catid]])
    tvDB.commit()

tvDB = db.connSQL('tv')
コード例 #3
0
ファイル: tv.py プロジェクト: Sandmann79/xbmc
    Log(imdbid + asins.split(',')[0])
    return imdbid


def setNewest(compList=False):
    Log('updating new seasons', xbmc.LOGDEBUG)
    if not compList:
        compList = getCategories()
    catList = compList['tv_shows']
    db.waitforDB(tvDB)
    c = tvDB.cursor()
    db.cur_exec(c, 'drop table if exists categories')
    db.cur_exec(c, 'create table categories(title TEXT, asins TEXT)')
    db.cur_exec(c, 'update seasons set recent=null')
    count = 1
    for catid in catList:
        if catid == 'PrimeTVRecentlyAdded':
            for asin in catList[catid]:
                seasonasin = lookupTVdb(asin, rvalue='seasonasin')
                if not seasonasin:
                    seasonasin = asin

                db.cur_exec(c, "update seasons set recent=? where asin like (?)", (count, '%' + seasonasin + '%'))
                count += 1
        else:
            db.cur_exec(c, 'insert ignore into categories values (?,?)', [catid, catList[catid]])
    tvDB.commit()


tvDB = db.connSQL('tv')