def get_show_data(series_title, mode = '', sitemode = '', url = '', sitedata = None): series_title = replace_signs(smart_unicode(series_title)) if not os.path.exists(ustvpaths.DBFILE): database.create_db() database.check_db_version() showdata = get_serie(series_title, mode, sitemode, url, forceRefresh = False, sitedata = sitedata) return showdata
def fetch_showlist(favored = 0): if not os.path.exists(ustvpaths.DBFILE): database.create_db() refresh_db() elif not favored: refresh = False command = 'select distinct mode from shows order by mode' modes = database.execute_command(command, fetchall = True) mode_list = [element[0] for element in modes] for network in get_networks(): if addon.getSetting(network.SITE) == 'true' and network.SITE not in mode_list: refresh = True if refresh: refresh_db() database.check_db_version() command = "select * from shows where url <> '' and hide <> 1 and favor = ? order by series_title" return database.execute_command(command, fetchall = True, values = [favored])