"Play next song automatically" in plugin - doable?

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
mbetter Offline
Member
Posts: 62
Joined: Nov 2010
Reputation: 0
Post: #1
I made a music plugin, is there any way to get the next song in the directory to play automatically when a song ends?
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 25,688
Joined: Oct 2003
Reputation: 169
Post: #2
XBMC will do that automatically assuming you have the option enabled.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
mbetter Offline
Member
Posts: 62
Joined: Nov 2010
Reputation: 0
Post: #3
jmarshall Wrote:XBMC will do that automatically assuming you have the option enabled.

It doesn't seem to be working for me. I can queue the entire directory, but for some reason I can't get album art to show up when I do it that way.

I add my directories with:

Code:
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

and my links with:

Code:
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

Where url is of the type: http: //ampache-server.com/a/play.php?song=1000...

I think I'm missing something here.
find quote
NordishByNature Offline
Member
Posts: 67
Joined: Nov 2010
Reputation: 0
Post: #4
Hello,

Maybe you have to set the Music.AlbumArt since you're using InfoLabels?

Just an Idea not tested.

cu Nordish
find quote
mbetter Offline
Member
Posts: 62
Joined: Nov 2010
Reputation: 0
Post: #5
NordishByNature Wrote:Hello,

Maybe you have to set the Music.AlbumArt since you're using InfoLabels?

Just an Idea not tested.

cu Nordish

I can't find any reference to this in the documentation, can you clarify?
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #6
actually jmarshall it doesn't auto-advance for plugins. the viewstate does not return autoplay...
find quote
mbetter Offline
Member
Posts: 62
Joined: Nov 2010
Reputation: 0
Post: #7
Thanks, spiff, I feel like slightly less of an idiot now Smile

While you're around, any clue about my thumbnail issue, i.e. thumbnails showing up when i open a (plugin) directory and play a link by itself but not when I queue the whole directory?
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 25,688
Joined: Oct 2003
Reputation: 169
Post: #8
In what cases would we not want autoplay? I can't think of any (for a music plugin).

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #9
none what so ever. it's a bug in my view
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #10
fixed in r35433
find quote
mbetter Offline
Member
Posts: 62
Joined: Nov 2010
Reputation: 0
Post: #11
Thanks, spiff!
find quote
nmirza Offline
Fan
Posts: 330
Joined: Mar 2008
Reputation: 0
Post: #12
Hi Spiff, i just installed r35744 and xbmc still doesn't play the next song automatically when the current one i selected ends. i made sure the option to play next song automatically is also selected in options.
could you pleaselook into this thanks.

spiff Wrote:fixed in r35433
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #13
works fine for me in all add-ons. must be your end.
find quote
mbetter Offline
Member
Posts: 62
Joined: Nov 2010
Reputation: 0
Post: #14
I've also had no luck with this. During play, I'll see "Next:" pop up over the currently playing song title with nothing next to it.

Is there something specific I have to do to set the next song?

Code:
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
find quote
mbetter Offline
Member
Posts: 62
Joined: Nov 2010
Reputation: 0
Post: #15
I got it working by using SetResolvedURL.

I would like to know if it's possible to do it without SetResolvedURL as my current plugin doesn't really need it (AFAIK) and it introduces a redundant plugin call in between songs.
find quote
Post Reply