2010-11-19, 01:57
I made a music plugin, is there any way to get the next song in the directory to play automatically when a song ends?
jmarshall Wrote:XBMC will do that automatically assuming you have the option enabled.
def addDir(name,object_id,token,mode,iconimage):
xbmc.log(name,xbmc.LOGNOTICE)
u=sys.argv[0]+"?object_id="+str(object_id)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)+"&token="+token
ok=True
liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
liz.setInfo( type="Music", infoLabels={ "Title": name } )
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
return ok
def addLink(name,url,iconimage,node):
ok=True
liz=xbmcgui.ListItem(name, iconImage=iconimage, thumbnailImage=iconimage)
liz.setInfo( type="Music", infoLabels={ "Title": node.findtext("title"), "Artist": node.findtext("artist"), "Album": node.findtext("album"), "TrackNumber": str(node.findtext("track")) } )
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
return ok
NordishByNature Wrote:Hello,
Maybe you have to set the Music.AlbumArt since you're using InfoLabels?
Just an Idea not tested.
cu Nordish
spiff Wrote:fixed in r35433
def addLinks(elem):
ok=True
li=[]
for node in elem:
liz=xbmcgui.ListItem(node.findtext("title").encode("utf-8"), iconImage=node.findtext("art"), thumbnailImage=node.findtext("art"))
liz.setInfo( type="Music", infoLabels={ "Title": node.findtext("title").encode("utf-8"), "Artist": node.findtext("artist"), "Album": node.findtext("album"), "ReleaseDate": str(node.findtext("year")) } )
tu= (node.findtext("url"),liz)
li.append(tu)
ok=xbmcplugin.addDirectoryItems(handle=int(sys.argv[1]),items=li,totalItems=len(elem))
return ok