2011-10-22, 16:38
Eldorado Wrote:What happens when you pass in those values? Do you see 0's in xbmc?
I would hope it would just not display them.. sort of like a i' value > 0' then display type of check
Hey Eldorado
No i keep getting script errors after loading so many menu Dirs, i think on Rating or Duration.
when i take out the code for them and dont add them to dir it works.
Nothing is getting displayed when using infolabels['rating']=float(0) etc but this must be where it errors out
Here is my def to load Directories.
Code:
def add_Metadirectory(self, queries, infolabels,title='', img='', fanart='', resolved=False, total_items=0, item_type='video'):
infolabels = self.unescape_dict(infolabels)
url = self.build_plugin_url(queries)
listitem = xbmcgui.ListItem(title, iconImage=img, thumbnailImage=img)
self.log_debug(u'adding movie: %s - %s' % (infolabels['title'], infolabels['rating']))
if infolabels['plot'] is None:
infolabels['plot']=''
if infolabels['rating'] is None:
infolabels['rating']=str('')
if infolabels['genre'] is None:
infolabels['genre']=''
if infolabels['duration'] is None:
infolabels['duration']=str('')
if infolabels['mpaa'] is None:
infolabels['mpaa']=''
if infolabels['trailer_url'] is None:
infolabels['trailer_url']=''
if infolabels['cast'] is None:
infolabels['cast']=''
listitem.setInfo('video', {'Title': title, 'Genre': infolabels['genre'], 'Plot': infolabels['plot'], 'Rating': float(infolabels['rating']),
'Duration': infolabels['duration'],'Cast': infolabels['cast'],'Trailer': infolabels['trailer_url']})
xbmcplugin.addDirectoryItem(self.handle, url, listitem, isFolder=True, totalItems=total_items)
and the calling line in my addon is:
addon.add_Metadirectory({'mode' : 'GetMovieSource', 'url' : url }, meta ,total_items=len(match),title=CleanHTML(name) + ' (' + sYear + ')' , img=meta['cover_url'])
Just Pushed a New Git for you to test.
if i do this listitem.setInfo('video', {'Title': title, 'Genre': infolabels['genre'], 'Plot': infolabels['plot'],'Cast': infolabels['cast'],'Trailer': infolabels['trailer_url']})
then it works and the menu's get load and i can see the thumbnail, i can get plot etc.