JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC

  Thread Rating:
  • 8 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Montellese Offline
Team Kodi Developer
Posts: 4,799
Joined: Jan 2009
Reputation: 66
Location: Switzerland
Post: #3376
(2017-01-07 10:06)joethefox Wrote:  So, can someone explain me when the issues occurConfused

It's because the problem only happens when trying to play multiple songs from a plugin and not from a smartplaylist. With smartplaylists (which the original report a few posts ago mentioned) everything is fine but when trying to add songs from a plugin directory they are returned in a random order and Kodi doesn't know which sorting method to use to sort them appropriately so they are added in a seemingly random order.

Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
find quote
Tolriq Offline
Donor
Posts: 3,015
Joined: Jun 2009
Reputation: 97
Location: France
Post: #3377
The issue also occurs with XSP....

Code:
{"jsonrpc":"2.0","method":"Playlist.Add","id":-2067158130,"params":{"playlistid":0,"item":{"directory":"special://profile/playlists/music/Long Tracks.xsp"}}}

{"jsonrpc":"2.0","method":"Player.Open","id":1877953368,"params":{"options":{"shuffled":true},"item":{"playlistid":0,"position":0}}}

You are forcing the shuffled option, of course in that case it works, but you forget the main point of XSP files, they have this setting inside them, an XSP can be shuffled or not, and there's no way to get this param inside the XSP from JSON.

So normally when you play an XSP file it should be ordered in the XSP defined order, specially since you have no way to know what the user configured in it's XSP file to reproduce it.

You can reproduce also with an m3u, create an m3u file with tracks that are not in alphabetical order (Because yes 95% of users have track number first in m3u so the order by luck does match) and see that the tracks are not added in the order of the m3u but in the alphabetical order.

And party mode is a special thing completely different also as it does not use the xsp random param and only load 10 songs at a time in the manageable playlist and reorder after each play meaning a complete different target than playing 2 albums in random order.

So yes iOS users have this issue and some others, they just do not report or explain the issue, but since I do provide some advanced support in a lot of ways I do have a lot more user contact and logs and details than some other remote makers Wink

Anyway I only answer because Yatse was said to have the issue when it's not, I no more really care about Kodi fixing or not, I send users here Wink But I was proven right each time there was argument over JSON not sure some want to try me again Wink (With all due respect of course).

Edit for @Montellese, the issue is that by default Kodi should not add a sort order when expanding playlist / directories as the provider already give the data in the wanted order. (There also a bug on linux with directories on usb drive that add files in reverse order for unknown reason but hard to reproduce so never really reported this one). If you think it should (I don't) then maybe the simplest solution would be to add a param to disable that. But logic says opposite, by default use the provider sort and optionally allow the caller to force a sort.

And edit for @ncarthy (But for @Montellese too as already asked) The problem about JSON api is that we can't pass metadata when adding things to playlist. Or there would be some other workarounds possible (See a Team member requesting that here : http://forum.kodi.tv/showthread.php?tid=300522)
(This post was last modified: 2017-01-07 14:08 by Tolriq.)
find quote
joethefox Offline
Team-Kodi Member
Posts: 1,814
Joined: Nov 2010
Reputation: 55
Post: #3378
There is a XSP. Player.Open: Shuffle options true -> then it's shuffled, Shuffle options false -> then it's not shuffled. Don't rely on kodi but offer the option to the users to choose. Simple. Or I'm missing something else?
find quote
Tolriq Offline
Donor
Posts: 3,015
Joined: Jun 2009
Reputation: 97
Location: France
Post: #3379
(2017-01-07 14:16)joethefox Wrote:  There is a XSP. Player.Open: Shuffle options true -> then it's shuffled, Shuffle options false -> then it's not shuffled. Don't rely on kodi but offer the option to the users to choose. Simple. Or I'm missing something else?

You miss the fact that you are adding an unnecessary step on the remote to ask something that the user have already configured ?
You miss the fact that your solution does not work for m3u as shuffled or not there's no way to get the playlist in the order the user wanted ?

We can talk about our previous endless discussion about JSON versioning if you want. The fact that you think something does not change facts Wink

I know when there's my name some want to argue indefinitely to try to prove I'm wrong, but well I'm still waiting for that last part Wink

I'll now stop to discuss as I'm loosing my time, I've proven my point, you can debate about all possible hacky horrible workaround you can imagine. (One being list the content of the directory with sort none and add each song 1 by 1 to the playlist, but for a large directory this is ugly slow and for addons we can't add meta data).
find quote
joethefox Offline
Team-Kodi Member
Posts: 1,814
Joined: Nov 2010
Reputation: 55
Post: #3380
sorry I didn't mean to upset you
find quote
Millencolin007 Offline
Fan
Posts: 543
Joined: Mar 2012
Reputation: 15
Location: Switzerland
Post: #3381
I can confirm what Tolriq has said. In my remote control application m3u playlists are also queued in the wrong order when using Playlist.Add

Code:
"{"id":1,"jsonrpc":"2.0","method":"Playlist.Add","params":{"item":{"directory":"special://profile/playlists/music/test.m3u","recursive":true},"playlistid":0}}"
find quote
claymic Offline
Senior Member
Posts: 178
Joined: Apr 2012
Reputation: 6
Post: #3382
Hi
Ok, let me try again. About the PVR requests :
1 - There is a way to request and get all Broadcasts from all channels at once ? or i will have to request each channel individually ?
2 - Every time that i need to refresh the EPG i will have to request everything again or i can use a filter to tell, for exemple, that i only want Broadcasts with the "starttime" above some date ?
Regards
find quote
claymic Offline
Senior Member
Posts: 178
Joined: Apr 2012
Reputation: 6
Post: #3383
Hi,
How can i get images from Kodi if the login has a password with special characters ? I tried to escape the password, but this seems to not work. If i remove the special character in the password everything works fine.

http://kodi:[email protected]:8080/image/
http://kodi:[email protected]:8080/image/

Regards
Clayton
find quote
yallah Offline
Senior Member
Posts: 231
Joined: May 2011
Reputation: 2
Location: Cannes, France
Post: #3384
Hi

Is it possible to get Retroplayer like player type

Code:
{ "id": 1, "jsonrpc": "2.0", "method": "Player.GetActivePlayers" }
thx
find quote
Jeremy White Offline
Member
Posts: 51
Joined: Nov 2012
Reputation: 0
Post: #3385
Did we agree that there is an issue with the json rpc interface and smart playlists?

Can we track this as a fairly substantial bug?

It limits many things I would like to do with JSON-RPC.

Where should a bug be filed?
find quote
onkel_enno Offline
Junior Member
Posts: 5
Joined: May 2014
Reputation: 0
Post: #3386
Hi.

Is it possible to add an actor (cast) to a movie with the SetMovieDetails method?
I'm missing it from the documentation.

Thanks
Enrico
find quote
Post Reply