From: Nicolas Boisselier Date: Thu, 4 Jul 2019 03:44:43 +0000 (+0100) Subject: addon.py X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=e1f94efd3e49e374cd2373e26fe34a42ea847cc9;p=plugin.video.news.nbdom.net.git addon.py --- diff --git a/addon.py b/addon.py index 194cd54..5abd6a8 100644 --- a/addon.py +++ b/addon.py @@ -123,6 +123,7 @@ def index(): sys.stderr = open(os.devnull, "w") content = getUrl('https://news.nbdom.net/videos/kodi/') + list = [] for row in json.loads(content): #row['link'] = ytUrl(row['id']) #row['link'] = resolve_url(row['link']) @@ -141,7 +142,7 @@ def index(): info['year'] = date.year info['premiered'] = date.strftime('%Y-%m-%d') #'-'.join([date.year,date.month,date.day]) info['dateadded'] = row['created'] - info['date'] = row['created'] + info['date'] = date.strftime('%Y-%m-%d') info['aired'] = row['created'] if 'id' in row: @@ -199,13 +200,16 @@ def index(): #li.setLabel2('setLabel2') #li.setThumbnailImage(thumbnailImage) - xbmcplugin.addDirectoryItem(handle=addon_handle,url=info['link'],listitem=li) + list.append([info['link'],li]) + # NB 04.07.19: Use xbmcplugin.addDirectoryItems, suppose to be faster + #xbmcplugin.addDirectoryItem(handle=addon_handle,url=info['link'],listitem=li) # NB 17.04.19 url = 'https://nbdom.net/data/en/911-experiments-The_Force_Behind_the_Motion.mp4' # NB 17.04.19 li = xbmcgui.ListItem('My First Video!', iconImage='DefaultVideo.png') # NB 17.04.19 xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li) if not TEST: + xbmcplugin.addDirectoryItems(addon_handle,list,len(list)) xbmcplugin.endOfDirectory(addon_handle) #