def RefreshList(): import tv import movies list_ = common.args.url mvlist = [] tvlist = [] pDialog = xbmcgui.DialogProgress() pDialog.create(common.__plugin__, common.getString(30117)) for asin in common.SCRAP_ASINS(common.movielib % list_): if not movies.lookupMoviedb(asin): mvlist.append(asin) for asin in common.SCRAP_ASINS(common.tvlib % list_): if not tv.lookupTVdb(asin, tbl='seasons'): tvlist.append(asin) if mvlist: movies.updateLibrary(mvlist) if tvlist: tv.addTVdb(False, tvlist) pDialog.close() if mvlist: movies.updateFanart() if tvlist: tv.updateFanart()
def ListCont(): import tv mov = False showonly = False rvalue = 'distinct *' url = common.args.url if 'movie' in url: mov = True if common.addon.getSetting('disptvshow') == 'true': showonly = True rvalue = 'seriesasin' asins = common.SCRAP_ASINS(url) if not asins: common.SetView('movies') return asinlist = [] for value in asins: ret = 0 if mov: ret = listmovie.LIST_MOVIES('asin', value, search=True, cmmode=1) if ret == 0 and not mov: for seasondata in tv.lookupTVdb(value, tbl='seasons', rvalue=rvalue, single=False): if not seasondata: continue if showonly: ret = 0 value = seasondata[0] for asin in tv.lookupTVdb(value, tbl='shows', rvalue='asin').split(','): if asin in asinlist: ret = 1 else: ret = 1 listtv.ADD_SEASON_ITEM(seasondata, disptitle=True, cmmode=1) if ret == 0 and not mov: listtv.LIST_TVSHOWS('asin', value, search=True, cmmode=1) asinlist.append(value) if mov: common.SetView('movies') else: common.SetView('tvshows')
def updateLibrary(asinlist=False): asins = '' if not asinlist: asinlist = common.SCRAP_ASINS(common.movielib % common.lib) MOVIE_ASINS = getMoviedbAsins(0, True) for asin in asinlist: found, MOVIE_ASINS = common.compasin(MOVIE_ASINS, asin) if not found: asins += asin + ',' deleteremoved(MOVIE_ASINS) else: asins = ','.join(asinlist) if not asins: return titles = appfeed.ASIN_LOOKUP(asins)['message']['body']['titles'] for title in titles: ASIN_ADD(title)
def checkLibraryAsins(asinlist): asins = '' removed_seasons = [] if asinlist == 'full': asinlist = common.SCRAP_ASINS(common.tvlib % common.lib) ALL_SEASONS_ASINS = getTVdbAsins('seasons', 0, True) for asin in asinlist: found, ALL_SEASONS_ASINS = common.compasin(ALL_SEASONS_ASINS, asin) if not found: asins += asin + ',' for item in ALL_SEASONS_ASINS: if item[1] == 0: removed_seasons.append(item[0]) deleteremoved(removed_seasons) else: asins = ','.join(asinlist) if not asins: return False return asins
def ListCont(export=False): import tv mov = False showonly = False rvalue = 'distinct *' if export: url = export export = True else: url = common.args.url if 'movie' in url: mov = True if common.addon.getSetting('disptvshow') == 'true': showonly = True rvalue = 'seriesasin' asins = common.SCRAP_ASINS(url) if not asins: xbmcgui.Dialog().notification(common.__plugin__, common.getString(30199), sound = False) return asinlist = [] for value in asins: ret = 0 if mov: ret = listmovie.LIST_MOVIES('asin', value, search=True, cmmode=1, export=export) if ret == 0 and not mov: for seasondata in tv.lookupTVdb(value, tbl='seasons', rvalue=rvalue, single=False): if seasondata: if showonly: ret = 0 value = seasondata[0] for asin in tv.lookupTVdb(value, tbl='shows', rvalue='asin').split(','): if asin in asinlist: ret = 1 else: ret = 1 listtv.ADD_SEASON_ITEM(seasondata, disptitle=True, cmmode=1, export=export) if ret == 0 and not mov: listtv.LIST_TVSHOWS('asin', value, search=True, cmmode=1, export=export) asinlist.append(value) if not export: if mov: common.SetView('movies', 'movieview') else: common.SetView('tvshows', 'showview')