addDirectoryItems display the list twice

kabcasa

New member
Apr 28, 2015
21
0
1
At home
i have make a function to display a list but i'm getting the double of items .Each item is displayed twice
if somebody can help PLS

Code:
def additems2( items,handle, folder=True,view_mode=None, is_update=False, cacheToDisc=True):

      items_list = []

      for item in items:

                li = xbmcgui.ListItem(item['label'],  iconImage=item['iconImage'],

                              thumbnailImage=item['thumbnail'])


      

        li.setArt({"poster": item['poster'], "icon": item['iconImage'],

                        "fanart" : item["fanart"]})


        cleaned_info = clean_dict(item.get('info'))

        if cleaned_info:

            li.setInfo('video', cleaned_info)


        if item.get('is_playable'):

            li.setProperty('IsPlayable', 'true')

              

        if item.get('context_menu'):

            li.addContextMenuItems(item['context_menu'])

              

        if item.get('info'):

            for key, val in item.get('info'):

                li.setProperty(key, val)

        items_list.append((item.get('url'), li,True))


      xbmc.log('len(items_list {}'.format(len(items_list)))

      xbmcplugin.addDirectoryItems(handle, items_list,len(items_list))
 
Last edited by a moderator: