Next track in audio queue?
#1
Hi folks,

Using Kodi alongside Housebot and Girder - both of which now have JSON RPC code for automation purposes. Work well.

Would love to finish off some items from the "to do" list, starting with this:

Next track display. e.g. <song title> <artist> So, what command is there for next track in an audio queue?


I've been looking and failing, but presume it's there and I'm missing it.

Any help very much appreciated!
Reply
#2
what you want is the Playlist namespace
http://kodi.wiki/view/JSON-RPC_API/v6#Playlist
Reply
#3
Thanks Axa88,

I've presumed you meant:

5.10.3 Playlist.GetItems
Get all items from playlist

If so, I had a good look at this, and I'm struggling to get much as an output. Does anyone know the parameter string that would complete the puzzle for next track?

My apologies for not being able to do this myself - more a hardware man...
Reply
#4
Sorry, for what I meant was take a look at the entire namespace Playlist as i assume doing this is a part of a bigger puzzle.
And now that I paused and gave it a thought, i realize it's not as simple as that.

You can indeed get an entire loaded playlist with the Playlist.GetItems method via json rpc, but i see no way to get the NEXT item that will be played unless you base it off list position and have shuffle set to OFF
And in that case you are only assuming the player will play the next item in the playlist (but that's a good assumption)

But imo this is not the way to do it. What you really need is the method GetInfoLabels
http://kodi.wiki/view/JSON-RPC_API/v6#XB...InfoLabels

With that you are able to query the world of infolables
http://kodi.wiki/view/InfoLabels
in this case ListItem.NextTitle, and directly get the next item to be played regardless of the players play pattern.

There's a lot more info available via this method, you may be glad you learned about it....
Reply
#5
Thanks again for this pointer.

No luck with ListItem.NextTitle - is this video (AVR) specific?
Reply
#6
Sorry again, now that you mention it, i see they are all labeled PVR ...

Honestly I haven't needed/tried to get the next playing but would like to know as well.

Any help here?
Reply
#7
Have you tried something like, $INFO[MusicPlayer.offset(1).Title] $INFO[MusicPlayer.offset(1).Artist]

This is how you would do it from a skinning perspective, not sure how that would translate to JSON-RPC.
Reply
#8
that would translate to using the above GetInfoLables with the info you provided... thanks.

MusicPlayer.Title Title of the currently playing song, also available are "MusicPlayer.offset(number).Title" offset is relative to the current playing item and "MusicPlayer.Position(number).Title" position is relative to the start of the playlist

Yep, it seems thats the way to go... but then again ive said that before... Big Grin
Reply

Logout Mark Read Team Forum Stats Members Help
Next track in audio queue?0