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)



- Montellese - 2012-02-05

You're guessing right. JSON-RPC can only provide metadata for files it has (successfully) scanned to the library except the usual things like file size, mime type etc (which is currently not available but will be after Eden) which can be easily read for any file.


- Mizaki - 2012-02-05

Using playlist.add by albumid adds the tracks in alphabetical order. I found an old post about adding a sort option which according to introspect isn't there yet. http://forum.xbmc.org/showpost.php?p=603000&postcount=316 I'd take it this would be a feature request now.

That being said, can I get it changed so it adds albums in track number order as a bug? I think it is Wink


- jw76 - 2012-02-05

hey folks, any plans on adding a JSON API call that allows us to search the Audio or Video libraries? I see we can currently request all or a specific id , but no functionality to search for a target string ?

jw


- Montellese - 2012-02-05

Mizaki Wrote:Using playlist.add by albumid adds the tracks in alphabetical order. I found an old post about adding a sort option which according to introspect isn't there yet. http://forum.xbmc.org/showpost.php?p=603000&postcount=316 I'd take it this would be a feature request now.
Yeah there's a feature request on trac for that but I didn't have the time to look at it yet.

Mizaki Wrote:That being said, can I get it changed so it adds albums in track number order as a bug? I think it is Wink
I agree that sorting by track number makes sense when providing an "albumid". The question is what to do when providing an "artistid" or a "genreid". Then sorting by track number doesn't make that much sense. It could be sorted by album (which IIRC should internally sort by track).

jw76 Wrote:hey folks, any plans on adding a JSON API call that allows us to search the Audio or Video libraries? I see we can currently request all or a specific id , but no functionality to search for a target string ?
Yes the specific plan is to provide the possibility to use the same fields/operators/logic as for smartplaylists to allow more detailed/specific queries through JSON-RPC. I have already done most of the work for it and it works great. But there are still some things that need to be fixed/ironed out.


- Mizaki - 2012-02-05

My tuppence worth, I'd say by default:
artistid: album title (alphabetical)->track number
genreid: artist (alphabetical)->album title (alphabetical)->track number

genreid adds albums in track number order already by happenstance. It seems to go by artistid->albumid->songid


- Montellese - 2012-02-05

Mizaki Wrote:My tuppence worth, I'd say by default:
artistid: album title (alphabetical)->track number
genreid: artist (alphabetical)->album title (alphabetical)->track number

genreid adds albums in track number order already by happenstance. It seems to go by artistid->albumid->songid

Agreed and done: https://github.com/xbmc/xbmc/commit/ff23548fc96afbdcfd1f3293506b97c6d93810d2


- Mizaki - 2012-02-05

Great, thanks.


- Mizaki - 2012-02-06

Sorry, me again Smile

GetShows sort by "none" seems to get the shows in alphabetical order. The other ones I use return by ascending id number. I use it to sort by "added". Is there a reason why it's different? And should I not be relying on "none" to return in id order?

Thanks.


- Montellese - 2012-02-06

As the term "none" indicates you can't know what it's sorted by. It's sorted the way it is stored in and returned by the database. TV shows might not be the only ones returned alphabetically. I actually just found out that in XBMC GUI you e.g. can sort movies by "Date added" (internally it's sorted by id AFAICT) but I'll have to investigate if this is also possible for other video items.


- Mizaki - 2012-02-06

Okay, thanks. I'll leave it as is for now and if it breaks later so be it. Sorting by added I find quite useful so it'll be good if it can be done.


- Montellese - 2012-02-06

I just checked and it's currently not possible in XBMC to sort tvshows by Date added so JSONRPC can't support it either. But I'm actually working on adding better/real support for sorting by "Date added" because I hate it wen a movie (that has probably been in my library for a year or two) I just manually refreshed re-appears in the recently added list.


- edrikk - 2012-02-06

Montellese Wrote:I just checked and it's currently not possible in XBMC to sort tvshows by Date added so JSONRPC can't support it either. But I'm actually working on adding better/real support for sorting by "Date added" because I hate it wen a movie (that has probably been in my library for a year or two) I just manually refreshed re-appears in the recently added list.

This is GREAT to hear Montellese! I'm hoping that as part of your work, there will be an option so that when items are added to the library for the FIRST time, XBMC can use the file modification timestamp to import media and build its database.

From a user's perspective, the 'recently added' list will make sense, as it is truly what was most recently added to his machine (and in turn library). Which in turn will make the first time user experience better (as to them, items most recently added to their machine is correctly communicated via XBMC).

This will also make life much easier for folks who test out XBMC, as it allows for the database to be rebuilt in a usable fashion for them (imagine if you have only 1 machine, you decide to test out a new build which doesn't work well, and you must start fresh). Your family is looking at the recently added list, and are not overly pleased with your 'experiment.'

I'm quite excited about this, as (in my personal opinion) the lack of such functionality makes the 'recently added' an aggravation/incorrect in several non-boundary cases (e.g. new users, rebuilds, and the case you outline)

Thanks!!!


- Montellese - 2012-02-06

edrikk Wrote:This is GREAT to hear Montellese! I'm hoping that as part of your work, there will be an option so that when items are added to the library for the FIRST time, XBMC can use the file modification timestamp to import media and build its database.

I didn't consider that but it's a good suggestion. I'll see whether I'll make that optional or always use the file modification timestamp (although that might become troublesome with tvshow directories).


- doozer - 2012-02-07

Hi All,

Playing with Eden Beta 2.
When I get a Player.OnPlay notification, I request the currently playing item by sending:

Code:
{"jsonrpc": "2.0", "method": "Player.GetItem", "params": {"playerid": 0, "properties": ["title","artist","year","rating","albumartist","track","duration","file"]}, "id": "Player.GetItem"}

I get back:
Code:
{"id":"Player.GetItem","jsonrpc":"2.0","result":{"item":{"albumartist":"","artist":"Green Day","duration":273,"file":"E:\\music\\Green_Day-Bullet_In_A_Bible-2005-XXL\\01-Green_Day-Bullet_In_A_Bible.mp3","id":408,"label":"11. Green Day - Wake Me Up When September Ends (Live)","rating":48,"title":"American Idiot (Live)","track":1,"type":"song","year":2005}}}

My question is, given track 11 of the album is playing, why does the title indicate the album name, and the file is pointing to the first track of the album (rather than the file that's currently playing)?

How do I obtain the song name (in this case "Wake Me Up When September Ends (Live)") via the JSON v3 api?

Thanks,
Matt.


- Montellese - 2012-02-07

I just tested this with several different albums and several different positions in the playlist (i.e. different tacks) and using your request I always get the expected result. All returned properties (except "albumartist" which was empty) contained the expected value.