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

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



- noem - 2010-04-28 12:58

Files.Getshares --> I can confirm it doesn't work for me to.


- Bram77 - 2010-04-28 21:28

Isn't in introspect either (compiled just minutes ago from SVN)


- topfs2 - 2010-04-28 21:55

@Bram77
If your on head then active playlists have been moved to AudioPlaylist and VideoPlaylist, just so you know. the old playlist(id=video) shouldn't be there anymore IIRC.

Also in trunk its Files.GetSources IIRC, I changed it at some point.

In regards to inconsistencies with audio and music in most parts it should be audio but I might have forgotten a few so if you find them please list them and I'll fix Smile

In regards to AudioLibrary, tbh I haven't finalized on that for now there is nothing except music in there but I guess AudioBooks might make it in there at some point, question is if it will be in the musiclibrary or not, so I'm abit afraid of making it general if it isn't. Say there will be a seperate audiobooklibrary, then having that library and audiolibrary might be confusing, but I'm open for discussions on this Smile

Thanks everyone for the inputs!

P.S Nice work on the webinterface bram Smile


- Bram77 - 2010-04-30 15:01

That's why I like the....

Xbmc.Library.Audio.Music
Xbmc.Library.Audio.Books
Xbmc.Library.Video.Movies
Xbmc.Library.Video.TvSeries
etc...

...namespace structure. You will never have to change any names, you can simply extend the namespace and (in the most extreme cases) move some methods. If you'd write the "Xbmc.Library" namespace methods smart, extending it for specific media types is a breeze. A consistent and matching database architecture will help too of course.

I haven't looked at any code in XBMC regarding the remote api's, so I'm not aware of any of the limitation you're facing...


Movie watched ? - noem - 2010-05-02 11:00

How can I find out if a Movie has been watched ? I have tryed by:
Code:
VideoLibrary.GetMovies '{"start": 0,"end":1,"fields": ["watched"] }'
but this dosn't seem to work I dont know it this is the correct field ?

Regards


- Bram77 - 2010-05-02 14:33

Could type="directories" be added to Files.GetDirectory? Since there is no reliable way to check if a returned path is a file or a directory with Javascript (can't access the file system with JS)...


- slash - 2010-05-02 15:53

Bram77 Wrote:Could type="directories" be added to Files.GetDirectory? Since there is no reliable way to check if a returned path is a file or a directory with Javascript (can't access the file system with JS)...

You could check if last character is a / or \. You can check my XWMM code (look for isDirectory() in XWMM/files/include.js)


- Bram77 - 2010-05-02 16:25

Should have thought of that Frown. Still, it would be much more efficient to let the api handle this.


- topfs2 - 2010-05-02 16:56

Yeah, the Files.GetShares and GetDirectories should return seperate entries of files and directories for easy parsing, still not sure how to handle those that are both? rar, m3u, zips and so on. Any suggestions? Smile

Also @ Bram and other. I know core, tbh probably stared myself blind on core of xbmc Smile. Thats one of the biggest reason for pushing jsonrpc to trunk, Its not meant to be designed for people that know core, quite the opposite, those that know core rarely creates stuff outside core Smile

I think I'm convinced on moving MusicLibrary -> AudioLibrary. Unless anyone objects I'll be renaming to it.

@noem
For now, watched filtering isn't in. but you can get the field "playcount" which gives you the information.

Cheers,
Tobias


- Bram77 - 2010-05-02 20:09

They aren't directories, they are files. So I think they should be treated as such to keep things consistent and clear for the client app. Maybe you could add a flag to the files return values telling that it's a special type of file, one that's allowed to be accessed like a directory.

edit:
I think it's mentioned before.... But the I can't get any directory content filtered.

Code:
{"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"type":"music","directory":"/a/dir/containing/audio/files/"},"id":1}

...returns all content, the same goed for the "video" flag.


- Bram77 - 2010-05-04 00:53

Thanks for the file/directory separation topfs2! It's making things easier Smile

[Image: xbmcweb_browsing_files.jpg]


- topfs2 - 2010-05-04 08:20

glad you liked it Smile Will try to add the other suggestions aswell ASAP.

Also note for those that used the thumb/url_to_thumb.tbn.jpg I've removed that and done a proper mime-type (well it just hints jpeg so not perfect) on the vfs, so use that one instead.


System.GetInfo - params ? - noem - 2010-05-04 19:14

What are the params for System.GetInfo ? I tryed { } but it dosn't work and in the dev docks it dost say anything about the params for this function:
System.GetInfo true ReadData Retrieve info about the system

Kind Regars


- dmsuperman - 2010-05-08 07:27

Is there an API guide for this somewhere? I'm trying to write an interface and teh pastebin log seems incomplete. Specifically I'm trying to figure out how to manage/access the "now playing" queue, is this even possible yet?


- topfs2 - 2010-05-08 09:51

dmsuperman Wrote:Is there an API guide for this somewhere? I'm trying to write an interface and teh pastebin log seems incomplete. Specifically I'm trying to figure out how to manage/access the "now playing" queue, is this even possible yet?

I would recommend you to check out the poc_jsonrpc web interface (in svn). It may be js but it shows off kindof simply how to use the API. I will write up a wiki when I'm confident it won't change all to much.

Btw the pastebin log can be disregarded, navigate to the development section of the webinterface (http://IP_TO_XBMC:8080/development.html) it will generate all the methods available.

The nowplaying queue is accessible under AudioPlaylist and VideoPlaylist.