def downloader1(): thumb = control.addonThumb() ; fanart = control.addonFanart() status = control.window.getProperty(property + '.status') if not downloadPath == '': item = control.item('[COLOR FF00b8ff]ESLPORA IL TUO DISPOSITIVO[/COLOR]', iconImage=thumb, thumbnailImage=thumb) item.addContextMenuItems([], replaceItems=True) item.setProperty('fanart_image', fanart) control.addItem(handle=int(sys.argv[1]), url=downloadPath, listitem=item, isFolder=True) if status == 'downloading': item = control.item('[COLOR red]Stop Downloads[/COLOR]', iconImage=thumb, thumbnailImage=thumb) item.addContextMenuItems([], replaceItems=True) item.setProperty('fanart_image', fanart) control.addItem(handle=int(sys.argv[1]), url=sys.argv[0]+'?action=stopDownload', listitem=item, isFolder=True) else: item = control.item('[COLOR FF00b8ff].[/COLOR]', iconImage=thumb, thumbnailImage=thumb) item.addContextMenuItems([], replaceItems=True) item.setProperty('fanart_image', fanart) control.addItem(handle=int(sys.argv[1]), url=sys.argv[0]+'?action=startDownload', listitem=item, isFolder=True) if status == 'downloading': item = control.item('[COLOR gold]Download Status[/COLOR]', iconImage=thumb, thumbnailImage=thumb) item.addContextMenuItems([], replaceItems=True) item.setProperty('Fanart_Image', fanart) control.addItem(handle=int(sys.argv[1]), url=sys.argv[0]+'?action=statusDownload', listitem=item, isFolder=True) def download(): return [] result = cache.get(download, 600000000, table='rel_dl') for i in result: try: cm = [] cm.append(('Remove from Queue', 'RunPlugin(%s?action=removeDownload&url=%s)' % (sys.argv[0], urllib.quote_plus(i['url'])))) item = control.item(i['name'], iconImage=i['image'], thumbnailImage=i['image']) item.addContextMenuItems(cm, replaceItems=True) item.setProperty('fanart_image', fanart) item.setProperty('Video', 'true') item.setProperty('IsPlayable', 'true') control.addItem(handle=int(sys.argv[1]), url=i['url'], listitem=item) except: pass control.directory(int(sys.argv[1]), cacheToDisc=True)
def endDirectory(): #control.do_block_check(False) control.directory(int(sys.argv[1]), cacheToDisc=True)
def endCategory(): #control.do_block_check(False) if control.skin == 'skin.confluence': control.execute('Container.SetViewMode(500)') control.directory(int(sys.argv[1]), cacheToDisc=True)