예제 #1
0
파일: tv.py 프로젝트: Versatilus/xbmc
def updateFanart():
    if tvdb_art == '0': return
    asin = title = year = None
    seasons = False
    c = tvDB.cursor()
    sqlstring = 'select asin, seriestitle, fanart, poster from shows where fanart is null'
    common.Log('TV Update: Updating Fanart')
    if tvdb_art == '2':
        sqlstring += ' or fanart like "%images-amazon.com%"'
    if tvdb_art == '3':
        sqlstring += ' or poster like "%images-amazon.com%"'
        seasons = True
    for asin, title, oldfanart, oldposter in c.execute(sqlstring).fetchall():
        title = title.lower().replace('[ov]', '').replace('[ultra hd]', '').replace('?', '').replace('omu', '').split('(')[0].strip()
        tvid, poster, fanart = appfeed.getTVDBImages(title, seasons=seasons)
        if not fanart: fanart = appfeed.getTMDBImages(title, content='tv')
        if oldfanart and not fanart: fanart = oldfanart
        if oldposter and not poster: poster = oldposter
        if tvid:
            if not fanart: fanart = common.na
            if not poster: fanart = common.na
        c.execute("update shows set fanart=? where asin = (?)", (fanart, asin))
        if tvdb_art == '3':
            c.execute("update shows set poster=? where asin = (?)", (poster, asin))
            if tvid:
                for season, url in tvid.items():
                    for singleasin in asin.split(','):
                        singleasin = '%' + singleasin + '%'
                        c.execute("update seasons set poster=? where seriesasin like (?) and season = (?)", (url, singleasin, season))
    tvDB.commit()
    common.Log('TV Update: Updating Fanart Finished')
예제 #2
0
파일: tv.py 프로젝트: versable/xbmc
def updateFanart():
    if tvdb_art == '0':
        return

    seasons = False
    c = tvDB.cursor()
    sqlstring = "select asin, seriestitle, fanart, poster from shows where fanart is null"
    Log('TV Update: Updating Fanart')
    if tvdb_art == '2':
        sqlstring += " or fanart like '%images-amazon.com%'"
    if tvdb_art == '3':
        sqlstring += " or poster like '%images-amazon.com%'"
        seasons = True
    db.waitforDB(tvDB)
    for asin, title, oldfanart, oldposter in db.cur_exec(c,
                                                         sqlstring).fetchall():
        title = title.lower().replace('[ov]', '').replace('[ultra hd]', '').replace('?', '') \
                .replace('omu', '').split('(')[0].strip()
        tvid, poster, fanart = appfeed.getTVDBImages(title, seasons=seasons)

        if not fanart:
            fanart = appfeed.getTMDBImages(title, content='tv')

        if oldfanart and not fanart:
            fanart = oldfanart

        if oldposter and not poster:
            poster = oldposter

        if tvid:
            if not fanart:
                fanart = na

            if not poster:
                fanart = na

        db.cur_exec(c, 'update shows set fanart=? where asin = (?)',
                    (fanart, asin))
        if tvdb_art == '3':
            db.cur_exec(c, 'update shows set poster=? where asin = (?)',
                        (poster, asin))
            if tvid:
                for season, url in tvid.items():
                    for singleasin in asin.split(','):
                        singleasin = '%' + singleasin + '%'
                        db.cur_exec(
                            c,
                            'update seasons set poster=? where seriesasin like (?) and season = (?)',
                            (url, singleasin, int(season)))
    tvDB.commit()
    Log('TV Update: Updating Fanart Finished')
예제 #3
0
파일: tv.py 프로젝트: Sandmann79/xbmc
def updateFanart():
    if var.tvdb_art == '0':
        return

    seasons = False
    c = tvDB.cursor()
    sqlstring = "select asin, seriestitle, fanart, poster from shows where fanart is null"
    Log('TV Update: Updating Fanart')
    if var.tvdb_art == '2':
        sqlstring += " or fanart like '%images-amazon.com%'"
    if var.tvdb_art == '3':
        sqlstring += " or poster like '%images-amazon.com%'"
        seasons = True
    db.waitforDB(tvDB)
    for asin, title, oldfanart, oldposter in db.cur_exec(c, sqlstring).fetchall():
        title = title.lower().replace('[ov]', '').replace('[ultra hd]', '').replace('?', '') \
                .replace('omu', '').split('(')[0].strip()
        tvid, poster, fanart = appfeed.getTVDBImages(title, seasons=seasons)

        if not fanart:
            fanart = appfeed.getTMDBImages(title, content='tv')

        if oldfanart and not fanart:
            fanart = oldfanart

        if oldposter and not poster:
            poster = oldposter

        if tvid:
            if not fanart:
                fanart = na

            if not poster:
                fanart = na

        db.cur_exec(c, 'update shows set fanart=? where asin = (?)', (fanart, asin))
        if var.tvdb_art == '3':
            db.cur_exec(c, 'update shows set poster=? where asin = (?)', (poster, asin))
            if tvid:
                for season, url in tvid.items():
                    for singleasin in asin.split(','):
                        singleasin = '%' + singleasin + '%'
                        db.cur_exec(c, 'update seasons set poster=? where seriesasin like (?) and season = (?)',
                                    (url, singleasin, int(season)))
    tvDB.commit()
    Log('TV Update: Updating Fanart Finished')
예제 #4
0
def updateFanart():
    if tvdb_art == '0':
        return
    asin = title = None
    seasons = False
    c = tvDB.cursor()
    sqlstring = 'select asin, seriestitle, fanart, poster from shows where fanart is null'
    common.Log('TV Update: Updating Fanart')
    if tvdb_art == '2':
        sqlstring += ' or fanart like "%images-amazon.com%"'
    if tvdb_art == '3':
        sqlstring += ' or poster like "%images-amazon.com%"'
        seasons = True
    for asin, title, oldfanart, oldposter in c.execute(sqlstring).fetchall():
        title = title.lower().replace('[ov]', '').replace('[ultra hd]', '').replace('?', '').replace('omu', '').split('(')[0].strip()
        tvid, poster, fanart = appfeed.getTVDBImages(title, seasons=seasons)
        if not fanart:
            fanart = appfeed.getTMDBImages(title, content='tv')
        if oldfanart and not fanart:
            fanart = oldfanart
        if oldposter and not poster:
            poster = oldposter
        if tvid:
            if not fanart:
                fanart = common.na
            if not poster:
                fanart = common.na
        c.execute("update shows set fanart=? where asin = (?)", (fanart, asin))
        if tvdb_art == '3':
            c.execute("update shows set poster=? where asin = (?)", (poster, asin))
            if tvid:
                for season, url in tvid.items():
                    for singleasin in asin.split(','):
                        singleasin = '%' + singleasin + '%'
                        c.execute("update seasons set poster=? where seriesasin like (?) and season = (?)", (url, singleasin, season))
    tvDB.commit()
    common.Log('TV Update: Updating Fanart Finished')