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')
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')
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')
def updateFanart(): if tmdb_art == '0': return asin = movie = year = None sqlstring = 'select asin, movietitle, year, fanart from movies where fanart is null' c = MovieDB.cursor() common.Log('Movie Update: Updating Fanart') if tmdb_art == '2': sqlstring += ' or fanart like "%images-amazon.com%"' for asin, movie, year, oldfanart in c.execute(sqlstring): movie = movie.lower().replace('[ov]', '').replace('omu', '').replace('[ultra hd]', '').split('(')[0].strip() result = appfeed.getTMDBImages(movie, year=year) if oldfanart: if result == common.na or not result: result = oldfanart updateMoviedb(asin, 'fanart', result) MovieDB.commit() common.Log('Movie Update: Updating Fanart Finished')
def updateFanart(): if tmdb_art == '0': return sqlstring = "select asin, movietitle, year, fanart from movies where fanart is null" c = MovieDB.cursor() Log('Movie Update: Updating Fanart') if tmdb_art == '2': sqlstring += " or fanart like '%images-amazon.com%'" db.waitforDB(MovieDB) for asin, movie, year, oldfanart in db.cur_exec(c, sqlstring): movie = movie.lower().replace('[ov]', '').replace('omu', '').replace( '[ultra hd]', '').split('(')[0].strip() result = appfeed.getTMDBImages(movie, year=year) if oldfanart: if result == na or not result: result = oldfanart updateMoviedb(asin, 'fanart', result) MovieDB.commit() Log('Movie Update: Updating Fanart Finished')
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')