Kodi Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174)
+---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



- jimk72 - 2011-10-26

Hmm I could have sworn that's how I was trying to open a movie. Must have had something wrong. So I am reading the printout from JSONRPC.Introspec correctly. I will try again when I get home.
I'm using tcp to send commands and a sort of telnet to watch the port and get results. Its worked good so far. I will have to look into using http to download the images once I parse the json. I thinking it would be best to create a cach folder for my program to use and only download thumbnails that are new. Should help with speed. Not sure how I am going to do music as I havnt used xbmc for my music. I have 98gb of music and last time I tried(old xbox days) xbmc struggled. May have to give it a try again.

Thanks again for all the help!!


- jimk72 - 2011-10-28

On notifications it has sender as xbmc. Shouldn't this be the device name you entered under network settings? I have 5 setups running xbmc and was wondering how to differentiate notifications from them. My main pc has xbmcvista as the device name. The one in my bedroom is xbmcbedroom ect.. Unless the sender has to be just xbmc?


- othrayte - 2011-10-28

jimk72 Wrote:On notifications it has sender as xbmc. Shouldn't this be the device name you entered under network settings? I have 5 setups running xbmc and was wondering how to differentiate notifications from them. My main pc has xbmcvista as the device name. The one in my bedroom is xbmcbedroom ect.. Unless the sender has to be just xbmc?

The sender is the program that is sending the message, xbmc sends messages, but so can add-ons, the addons use this field to specify who sent the message. Having the sender of xbmc messages as xbmc is important, only messages with xbmc as the sender can be guaranteed to have actually come from xbmc.

I think when you are getting notifications from different computers (this is what you are wanting to do isn't it) you would have to connect to each computer individually, and you would know that if the message arose on xyz connection then it came from that machine.


- Montellese - 2011-10-28

othrayte Wrote:The sender is the program that is sending the message, xbmc sends messages, but so can add-ons, the addons use this field to specify who sent the message. Having the sender of xbmc messages as xbmc is important, only messages with xbmc as the sender can be guaranteed to have actually come from xbmc.

I think when you are getting notifications from different computers (this is what you are wanting to do isn't it) you would have to connect to each computer individually, and you would know that if the message arose on xyz connection then it came from that machine.

Thanks othrayte, that's exactly why it should stay "xbmc". Furthermore the option to name an XBMC device has only been added a few weeks ago. But as already stated you have to "manually" connect to a certain computer so your client should already know which machine that is.


- jasonvp - 2011-10-28

I'm trying to use "Playlist.Swap" (in a similar way to "Move item" in the Context Menu) to move the currently playing song to another position. The problem is if say the currently playing song is at "position:6" and is moved to "position:0" the song moves correctly but the Playlist Position stays the same i.e. "position:6" instead of "position:0" (this is true in the GUI and "Player.GetProperties" results) so the next song to play is "position:7" instead of "position:1".

The reason I use this is because when a Playlist is active and I use "Player.Shuffle" I want the currently playing song to go to "position":0 like it should.

Is this a bug or should there be a "Playlist.MoveItem" method added as well?


Cheers
Jason


- Montellese - 2011-10-28

jasonvp Wrote:I'm trying to use "Playlist.Swap" (in a similar way to "Move item" in the Context Menu) to move the currently playing song to another position. The problem is if say the currently playing song is at "position:6" and is moved to "position:0" the song moves correctly but the Playlist Position stays the same i.e. "position:6" instead of "position:0" (this is true in the GUI and "Player.GetProperties" results) so the next song to play is "position:7" instead of "position:1".
I never used the "Move item" functionality so I'm not sure what I would expect it to do. But thinking about it the position should go to 0 because the currently playing item is at position 0.

jasonvp Wrote:The reason I use this is because when a Playlist is active and I use "Player.Shuffle" I want the currently playing song to go to "position":0 like it should.
Why should the currently playing item go to position 0 if you shuffle? IMO shuffle means that I don't know where any item will end up Wink


- jasonvp - 2011-10-28

Quote:Montellese;922817]I never used the "Move item" functionality so I'm not sure what I would expect it to do. But thinking about it the position should go to 0 because the currently playing item is at position 0.

"Move item" moves the item to the position you select and moves the selected position item and the rest of the items below it down one position.

Quote:Why should the currently playing item go to position 0 if you shuffle? IMO shuffle means that I don't know where any item will end up Wink

Most Media Players I have used do this e.g. iTunes. The reason for this is because when you shuffle a Playlist that has say 10 items in it and the currently playing item goes to position 9 (10) it will only play that item or however many items remain if the Playlist is longer and all other items before it remain unplayed. Doesn't make sense to me but that's just my opinion and you know what they say about opinions and bum holes. Wink

Yeah I could set it to Repeat All but I'm not repeat kind of guy. Smile So that is why I was going to use Playlist.Swap.

So do I fill in a Bug Ticket for "Playlist.Swap" or Feature Request for a "Playlist.MoveItem" method or both?


Cheers
Jason


- topfs2 - 2011-10-28

jasonvp Wrote:Most Media Players I have used do this e.g. iTunes. The reason for this is because when you shuffle a Playlist that has say 10 items in it and the currently playing item goes to position 9 (10) it will only play that item or however many items remain if the Playlist is longer and all other items before it remain unplayed. Doesn't make sense to me but that's just my opinion and you know what they say about opinions and bum holes. Wink

Sounds like a good idea IMO, its not really jsonrpc specific but I'd suggest you to fire away a feature request for it.


- Montellese - 2011-10-28

I agree with topfs2 that it's not really a JSON-RPC feature but should rather be changed in core. Otherwise it's another JSON-RPC hack which gets hard to maintain.

So if you create a feature request ticket set the category to Playlists (or whatever it's called).


Genres & Actors - dwagner - 2011-10-28

Hi,

I've gotten genres for movies using VideoLibrary.GetGenres. Now that I have the genreid how do I query movies for a specific genre?

In the same way as there is VideoLibrary.GetGenres is there a way to query actors for movies & tv shows? and subsequently then listing movies based on an actor?

I know I can get the cast from the VideoLibrary.GetMovies but that is inefficient and would require me to manually index the cast myself. For users with big libraries this would be painful.


- Montellese - 2011-10-28

dwagner Wrote:I've gotten genres for movies using VideoLibrary.GetGenres. Now that I have the genreid how do I query movies for a specific genre?
Not possible right now. Please create a feature request ticket on trac to add an optional "genreid" parameter to VideoLibrary.GetMovies (or something like that).

dwagner Wrote:In the same way as there is VideoLibrary.GetGenres is there a way to query actors for movies & tv shows? and subsequently then listing movies based on an actor?
That's not supported yet either. Another feature request ticket would help so I/we don't forget. Thanks.


- jimk72 - 2011-10-28

Ok, I have 1 memo field and 5 dif telnet components all sending text to the same memo. So the notifications all looked the same. Doing a net status app to monitor my home system. I will just add text before the notification stating which ip it is comming from.
Thanks for the info. Everything else is going good. Anytime one of my installs of xbmc starts a movie It displays the image of the movie and the title with movie Id. still working on parsing an array of items using json.
It took forever to figure out how to get the tbn files from xbmc. Finaly realized i was missing the vfs in the http call. Once I added that everything worked.


Playlist and Player IDs - gertjanzwartjes - 2011-10-29

I'm trying to figure out how to implement the following with the new Player and Playlist namespaces:
  1. Add a bunch of songs to a playlist
  2. Turn on shuffle
  3. Start playing the playlist
First I use Playlist.GetPlaylists, to find the ID for the audio playlist. Then add the songs to that playlist using Playlist.Add. Next I want to make sure shuffle is turned on *before* starting the player. Now here's the catch: I don't have the player ID, unless I would use a hardcoded ID of 0, because it seems that that is always the audio player ID.

I could first start the player with Player.Open using the playlist ID and then query for the active player, and shuffle that one. But in that case the player is already playing, so that is no good.

I can't find a way to figure out the audio player ID, maybe there should be something like Player.GetPlayers as well? Or should I just count on the fact that the player IDs will always be 0, 1 and 2 for audio, video and pictures respectively? Or am I just missing something?

Thanks


- Montellese - 2011-10-29

gertjanzwartjes Wrote:I can't find a way to figure out the audio player ID, maybe there should be something like Player.GetPlayers as well? Or should I just count on the fact that the player IDs will always be 0, 1 and 2 for audio, video and pictures respectively? Or am I just missing something?

For Eden the player IDs will always be 0, 1 and 2 for audio, video and pictures but this is just because the way XBMC curently handles players is a bit limited but that will change in the future and you won't be able to rely on any player having a specific ID.

Player.GetPlayers() doesn't make any sense because a player only exists if it is playing otherwise it simply doesn't exist. That's why there is only Player.GetActivePlayers().

But you are right it's currently not possible to shuffle BEFORE starting playback. Please create a feature request ticket for that functionality. Ideally there would be an "options" parameter for Player.Open which allows to pass parameters like "shuffled", "repeat", "resume" etc.


- gertjanzwartjes - 2011-10-29

Montellese Wrote:But you are right it's currently not possible to shuffle BEFORE starting playback. Please create a feature request ticket for that functionality. Ideally there would be an "options" parameter for Player.Open which allows to pass parameters like "shuffled", "repeat", "resume" etc.

That makes perfect sense. Thanks, I will create a ticket for it.