def addDirectory(self, items): if items == None or len(items) == 0: return sysaddon = sys.argv[0] addonFanart = control.addonFanart() addonThumb = control.addonThumb() artPath = control.artPath() for i in items: try: try: name = control.lang(i['name']).encode('utf-8') except: name = i['name'] if i['image'].startswith('http://'): thumb = i['image'] elif not artPath == None: thumb = os.path.join(artPath, i['image']) else: thumb = addonThumb url = '%s?action=%s' % (sysaddon, i['action']) try: url += '&url=%s' % urllib.quote_plus(i['url']) except: pass cm = [] #try: cm.append((control.lang(30239).encode('utf-8'), 'RunPlugin(%s?action=tvshowsToLibrary&url=%s)' % (sysaddon, urllib.quote_plus(i['context'])))) #except: pass item = control.item(label=name, iconImage=thumb, thumbnailImage=thumb) item.addContextMenuItems(cm, replaceItems=False) if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart) control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True) except: pass views.setView('tvshows', {'skin.confluence': control.viewMode['mediainfo1']}) control.directory(int(sys.argv[1]), cacheToDisc=True)
def addDirectory(self, items): if items == None or len(items) == 0: return sysaddon = sys.argv[0] addonFanart = control.addonFanart() addonThumb = control.addonThumb() artPath = control.artPath() for i in items: try: try: name = control.lang(i['name']).encode('utf-8') except: name = i['name'] if not artPath == None: thumb = os.path.join(artPath, i['image']) else: thumb = addonThumb url = '%s?action=%s' % (sysaddon, i['action']) try: url += '&url=%s' % urllib.quote_plus(i['url']) except: pass item = control.item(label=name, iconImage=thumb, thumbnailImage=thumb) item.addContextMenuItems([], replaceItems=False) if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart) control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True) except: pass control.directory(int(sys.argv[1]), cacheToDisc=True)
def addDirectory(self, items): if items == None or len(items) == 0: return sysaddon = sys.argv[0] addonFanart = control.addonFanart() addonThumb = control.addonThumb() artPath = control.artPath() for i in items: try: try: name = control.lang(i['name']).encode('utf-8') except: name = i['name'] if not artPath == None: thumb = os.path.join(artPath, i['image']) else: thumb = addonThumb url = '%s?action=%s' % (sysaddon, i['action']) try: url += '&url=%s' % urllib.quote_plus(i['url']) except: pass item = control.item(label=name, iconImage=thumb, thumbnailImage=thumb) item.addContextMenuItems([], replaceItems=False) if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart) control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True) except: pass control.directory(int(sys.argv[1]), cacheToDisc=True)
def addSimpleDirectory(self, items): if not items: return sysaddon = sys.argv[0] handle = int(sys.argv[1]) thumb = control.addonThumb() for i in items: query = i['title'] url = '%s?action=tvSearch&query=%s' % (sysaddon, urllib.quote_plus(query)) item = control.item(label=query, iconImage=thumb, thumbnailImage=thumb) control.addItem(handle=handle, url=url, listitem=item, isFolder=True) control.directory(handle, cacheToDisc=True)
def addDirectory(self, items): if items == None or len(items) == 0: return sysaddon = sys.argv[0] addonFanart = control.addonFanart() addonThumb = control.addonThumb() artPath = control.artPath() for i in items: try: try: name = control.lang(i['name']).encode('utf-8') except: name = i['name'] if i['image'].startswith('http://'): thumb = i['image'] elif not artPath == None: thumb = os.path.join(artPath, i['image']) else: thumb = addonThumb url = '%s?action=%s' % (sysaddon, i['action']) try: url += '&url=%s' % urllib.quote_plus(i['url']) except: pass cm = [] #try: cm.append((control.lang(30239).encode('utf-8'), 'RunPlugin(%s?action=tvshowsToLibrary&url=%s)' % (sysaddon, urllib.quote_plus(i['context'])))) #except: pass item = control.item(label=name, iconImage=thumb, thumbnailImage=thumb) item.addContextMenuItems(cm, replaceItems=False) if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart) control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True) except: pass views.setView('tvshows', {'skin.confluence': control.viewMode['mediainfo1']}) control.directory(int(sys.argv[1]), cacheToDisc=True)
def downloader(): thumb = control.addonThumb() ; fanart = control.addonFanart() status = control.window.getProperty(property + '.status') if not downloadPath == '': item = control.item('[COLOR FF00b8ff]Downloads[/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]+'?mode=stopDownload', listitem=item, isFolder=True) else: item = control.item('[COLOR FF00b8ff]Start 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]+'?mode=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]+'?mode=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?mode=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 downloader(): thumb = control.addonThumb() fanart = control.addonFanart() status = control.window.getProperty(property + '.status') if not downloadPath == '': item = control.item('[COLOR FF00b8ff]Downloads[/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]Start 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=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)