]> git.nbdom.net Git - plugin.video.news.nbdom.net.git/commitdiff
addon.py
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 4 Jul 2019 03:44:43 +0000 (04:44 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 4 Jul 2019 03:44:43 +0000 (04:44 +0100)
addon.py

index 194cd54fdda28b5a3b727c31ca003afe3be70fe4..5abd6a801bcee353ed8471c2ddacbe08642743df 100644 (file)
--- 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)
 
 #