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)



- jasonvp - 2011-08-05

topfs2 Wrote:Anyways, try JSONRPC.Version on their server, it really should return 2 otherwise they have merged development builds (which isn't good).

This was from a couple of months ago.
Boxee Box returned
Code:
{"id":1,"jsonrpc":"2.0","result":{"version":1}}

So what is 1? Dharma in development?

System info
Code:
{"id":1,"jsonrpc":"2.0","result":{"System.BuildVersion":"1.1.2.19250-8cbeb5c"}}
Code:
{"id":1,"jsonrpc":"2.0","result":{"System.BuildDate":"Jun 19 2011"}}



- topfs2 - 2011-08-05

yeah version 1 is Dharma in development, any of the odd numberings are impossible to target as they stretch over almost a year of development Smile

I'll see if I can start some discussion internally and possibly with boxee to see if we can resolve this somehow (so that each possible merge they do has a proper number and not a hit n' miss as the odd numbers are).

EDIT: For now I guess you can assume boxee if version 1, but its hardly a good solution in the future so will need to come up with something better


- topfs2 - 2011-08-05

jasonvp Wrote:The reason I asked was because I initially created a Widget for a Boxee Box for a friend and that got me interested in XBMC. So rather than reinventing the wheel I thought I would just add to my already made Widget for use with XBMC. This is also another reason why I'm using "System.GetInfoLabels" a lot because the Boxee Box has limited JSON commands.

Ah, well I like the idea of being able to mass fetch state variables so we might keep it somehow. Currently we are using the GUI InfoManager which I don't like that much but we could probably make a bit of a json-rpc specific variant when core gets cleaned up a bit.
jasonvp Wrote:When using "AudioPlayer.State" with the Boxee Box it returned the below even though no player was active.

Code:
{"id":3,"jsonrpc":"2.0","result":{"playing":false}}

I was just curious. Sorry for being be a pain in the bum.



Will do if you think it's worth the trouble?


Cheers
Jason

Yeah might aswell, because I agree with you that if we have [Audio|Video]Player those are virtual and probably shouldn't error. The merged might make sense to error so we need to have the discussion. And its summer time so lots of devs are on vaccation so we will easily forget about it without a trac ticket Smile


- jasonvp - 2011-08-06

Thanks topfs2. I created a Trac Ticket (Ticket #11815).


Cheers
Jason


- dann0 - 2011-08-07

topfs2 Wrote:Hmm, never tried this tbh. It sounds like partly a bug. Ideally it should behave as in GUI (perhaps with the option to query all artists no matter the setting). Please start a bugreport / feature request with a detailed list of how to reproduce (if you could upload your or a sample database that would also be quite nice, its up to you) and cc me and Montellese.

I agree that the GetArtists should only by default return those which are in GUI, we could add a GetArtist(allow_various=true) type of thing though which forces it to return them no matter the setting.

Ticket #11816

thank you Smile


- Zenshi - 2011-08-08

Hello all,

I'm trying to retreive the thumbnails for all the tv show seasons and episodes that I currently have in my library using a script, but can't seem to make it work...

The code i'm using is,
for Seasons Thumbs,
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetSeasons", "params": {"fields": ["thumbnail"] }, "id": 1}
and for Episodes Thumbs,
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": {"fields": ["thumbnail"] }, "id": 1}

I assume that "thumbnail" field exists for both methods?

Cheers,

Zenshi.


- thedroid - 2011-08-08

topfs2 Wrote:we could add a GetArtist(allow_various=true) type of thing though which forces it to return them no matter the setting.

I think having a force would be better, but it may be better to have GetArtist return all artists (as it does now) and GetArtist(albumartist=true) returns only Album Artists.

Just my 2c.


- topfs2 - 2011-08-08

thedroid Wrote:I think having a force would be better, but it may be better to have GetArtist return all artists (as it does now) and GetArtist(albumartist=true) returns only Album Artists.

Just my 2c.

Sorry if I wasn't clear, that flag I suggested is force. if omitted we would use the one in settings, if true we would have various artist in listing and if false we wouldn't


- thedroid - 2011-08-08

topfs2 Wrote:Sorry if I wasn't clear, that flag I suggested is force. if omitted we would use the one in settings, if true we would have various artist in listing and if false we wouldn't

I understood it as you described, but my point is as follows :- If I am making that call from a external program, and I want to get just AlbumArtists, how would I know what "GetAlbums" on its own is actually going to return as it will be dependant on the gui setting (is there an infolabel for this)? I guess the ultimate solution would be three versions i.e. GetArtist(use_gui=true) , GetArtist(album_artist=true) and GetArtist.


- topfs2 - 2011-08-09

thedroid Wrote:I understood it as you described, but my point is as follows :- If I am making that call from a external program, and I want to get just AlbumArtists, how would I know what "GetAlbums" on its own is actually going to return as it will be dependant on the gui setting (is there an infolabel for this)? I guess the ultimate solution would be three versions i.e. GetArtist(use_gui=true) , GetArtist(album_artist=true) and GetArtist.

yeah that was what I wanted but with just a different syntax Smile Unless I'm missunderstanding you?

GetArtist(album_artist=true) : Fetch ever single artist no matter if its various
GetArtist(album_artist=false) : Only fetch "pure" artists
GetArtist() : Use default from GUI.

Personally I prefer not having more than one bool because it gets rather unclear what you want if you do GetArtist(use_gui=true, album_artist=true). Obviosly we could use an enum though and have album_artist="default" or something, but I personally think bool and omit is better, but will discuss it a bit internally

Tangent of the topic, I'm also somewhat thinking that we should perhaps flag the items too, so that a client could do post-fetch filtering if they so desire, so each artist has a flag which states if its various or not. And when settings is wrapped the gui setting will be available there.


- thedroid - 2011-08-09

topfs2 Wrote:GetArtist(album_artist=true) : Fetch ever single artist no matter if its various
GetArtist(album_artist=false) : Only fetch "pure" artists
GetArtist() : Use default from GUI.

That is exactly what I was thinking of.

Sorry sometimes it takes a while for my brain to engage (and then only with a lot of prodding from other people) :-) .


- topfs2 - 2011-08-09

thedroid Wrote:That is exactly what I was thinking of.

Sorry sometimes it takes a while for my brain to engage (and then only with a lot of prodding from other people) :-) .

Ah great, I was worried I had missed a use case (never used the feature before so am very unsure on it Smile ). Always good to bounce ideas. Makes me wonder though if it isn't clear enough to use the bool + omit and perhaps we will have to do an enum string instead if its easier to instantly understand.


- Wanilton - 2011-08-09

Topfs2, i have little sugestion for Json in music, it´s possible get info about one tag custom field in music (example: Language), I use this resouce for listen appropriate info TTS Voice using voxcommando, example:
Whats song is this? language english, i have tts voice in english read info for me in native language track, in this case i Listen "This music is Made up My mind", for now I use field lyrics and http for implement this:

TTS = Text to Speech

http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=getcurrentlyplaying

Filename:musicdb://3/611/9209.mp3
PlayStatusTonguelaying
SongNo:0
Type:Audio
Title:Made up My Mind
Track:1
Artist:Savoy Brown
Album:A Step Further
Genre:Blues Rock
Year:1969
URL:C:\Shared Music\Savoy Brown\A Step Further (1969)\01 - Made Up My Mind.mp3
[b]Lyrics:EnglishUS

Bitrate:193
Samplerate:44
ThumbConfusedpecial://masterprofile/Thumbnails/Music/f/ffbc9937.tbn
Time:00:14
Duration:03:07
Percentage:7
File size:4723992
Changed:False

But this great if one way for this via Json..


- topfs2 - 2011-08-09

Wanilton Wrote:Topfs2, i have little sugestion for Json in music, it´s possible get info about one tag custom field in music (example: Language), I use this resouce for listen appropriate info TTS Voice using voxcommando, example:
Whats song is this? language english, i have tts voice in english read info for me in native language track, in this case i Listen "This music is Made up My mind", for now I use field lyrics and http for implement this:

TTS = Text to Speech

http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=getcurrentlyplaying

Filename:musicdb://3/611/9209.mp3
PlayStatusTonguelaying
SongNo:0
Type:Audio
Title:Made up My Mind
Track:1
Artist:Savoy Brown
Album:A Step Further
Genre:Blues Rock
Year:1969
URL:C:\Shared Music\Savoy Brown\A Step Further (1969)\01 - Made Up My Mind.mp3
[b]Lyrics:EnglishUS

Bitrate:193
Samplerate:44
ThumbConfusedpecial://masterprofile/Thumbnails/Music/f/ffbc9937.tbn
Time:00:14
Duration:03:07
Percentage:7
File size:4723992
Changed:False

But this great if one way for this via Json..

Sure, make a feature request and cc me and Montellese, I'm sure we could add lyrics as a possible field (and either have lyrics be an object with language and text members or have another field as lyric_language)


- jitterjames - 2011-08-09

Actually, I think what Wanilton really wants is access to the custom fields, like those that are used in MediaMonkey. There are tags called custom1 custom2 etc., but also he wants to request the contents of a tag by name as opposed to doing a general request and receiving all info for the song in one shot.

I have not looked too closely at the JSON spec yet so I don't don't know if this is already possible...