def add_items(items, showing={}): for url, name in items: showing_url = None if url in showing.keys(): showing_url = showing[url] info = scrapper.get_cached_info(furl(url)) if info: add_item(name, info, showing_url) else: info = scrapper._empty_info() info["url"] = url add_item(name, info, showing_url) xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_TITLE) xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_RATING) xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_YEAR)
def preload_items(results): step = 100.0 / len(results) prog = 0 pDialog = xbmcgui.DialogProgress() progress = pDialog.create(__language__(30019)) pDialog.update(prog, __language__(30019)) for url, name in results: if pDialog.iscanceled(): pDialog.close() return prog = float(prog + step) pDialog.update(int(prog), __language__(30019), name) if not scrapper.get_cached_info(furl(url)): scrapper.get_info(furl(url)) time.sleep(3) pDialog.close()