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)



- topfs2 - 2010-11-25

JSONRPC.Introspect have all info


- giftie - 2010-11-26

Ok, add JSONRPC.Introspect into my script to get the list...

I now have the proper formatting.

Now a question about the available fields. Are these the only fields available(looked at AudioLibrary.cpp to find)?

album
albumartist
artist
year
rating
genre
databaseid


Would albumpath be available? I've tried ["path"] and ["albumpath"] and just get a parse error...

If it's not available, would it be possible to have it added? Then I would be able to remove my dependence on the script.module.pysqlite and http api, making my script compatible with the two present available databases(MySQL and SQLite).

Thanks...


- topfs2 - 2010-11-26

Why do you need albumpath? an album could be in multiple paths so there is no good way to add it. And no, it will probably never be added, not unless there is a really good reason.


- giftie - 2010-11-26

This is going to seem a little off topic, but I am just trying to explain my request for albumpath to be added to the AlbumDetails query.

Many skins have a feature that displays rotating cd artwork(not the album artwork) while music is playing. The skinners agreed on that the artwork(cdart.png) is to be stored in the album folder, much like the Album Art gets stored in album folders. I had expanded on a plug-in that Ppic had written a while back, that manages the cd artwork. Right now the script uses a python module(pysqlite) to retrieve the information from the music DB. This is ok for probably 85-90% of the users. But there are those that use MySQL which at the moment there is not a Python module available to use in XBMC and precompiled modules are not allowed in the Official Addon repo where my script is available. My script pull the following information from the database, Album Artist(was not very easy to do this because of the structure of the Database), Album Title, Album Path. The Album Path is needed for the storage of the cdart.png that the script downloads off of a specific website(xbmcstuff.com, soon I will be setting up my own to add an uploading feature to my script). This is why I am asking if it would be possible to add the Album Path to JSON RPC..

You also have mentioned how the database structure is going to change and also how the accessing of the database will need to change for addons when this happens(yes I know it's not right away, but it is going to happen.)

For reference the following skins support this feature:

Transparency!
Night
Aeon65
Alaska Revisited
Alaska Revisited MOD
Cirrus(though spins them too fast)
Shade
Carmichael - upcoming skin

Not sure if this is a good enough reason or not to you, but I have to try....


- uNhoLy - 2010-11-26

it would be great if u could add functions to get the fanart. but with the addition to provide a maximum size in height or width so that the actual resizing happens on the xbmc machine, not on the consumer of the service. this would help many phone applications Smile.

keep up the good work!


- topfs2 - 2010-11-26

giftie Wrote:Not sure if this is a good enough reason or not to you, but I have to try....

Its a valid scenario but shouldn't you store the rotating cdart per songs albumpath? e.g say an album is split in /foo/part1 /foo/part2 you'd want it to have /foo/part1/cdart.png /foo/part2/cdart.png (Its normal if you consider multidisk albums, atleast I store them almost like that).

So you could do something like
Code:
for each song in GetSongs(albumid)
  if (not file.Exist(StripFilePath(song["file"]) + 'cdart.png'))
    DownloadCDArt()

This way it would cover the multidisk for free, yeah it would be a tad more work that just getting the paths but not a whole lot.

I haven't really dabbled with the cdart stuff so I might very well be missing something though Smile

Also if so many skins use it this might want to get proper support in core.


uNhoLy Wrote:it would be great if u could add functions to get the fanart. but with the addition to provide a maximum size in height or width so that the actual resizing happens on the xbmc machine, not on the consumer of the service. this would help many phone applications Smile.

keep up the good work!

Something we for sure want, hopefully everything will be in place for that in eden. (waiting on a better image library for it).

Will also hopefully support transcoding of video with the same goal.


- uNhoLy - 2010-11-26

topfs2 Wrote:Something we for sure want, hopefully everything will be in place for that in eden. (waiting on a better image library for it).

Will also hopefully support transcoding of video with the same goal.

hm why waiting for a better image library? the pictures are jpegs and there are plenty of jpeg decoders around. i think this shouldnt be the problem? or what are you missing from the existing jpeg decoders?


- topfs2 - 2010-11-26

uNhoLy Wrote:hm why waiting for a better image library? the pictures are jpegs and there are plenty of jpeg decoders around. i think this shouldnt be the problem? or what are you missing from the existing jpeg decoders?

I need to decode, scale then encode again. Can't be done with our current (just a decoder).

Eden will, most likely, have a new image library which can do it though.


- Montellese - 2010-11-26

topfs2 Wrote:I need to decode, scale then encode again. Can't be done with our current (just a decoder).

Eden will, most likely, have a new image library which can do it though.

What about ImageMagick? Ok it might be a bit of an overkill but it can do all kinds of conversions very easily. I'm not sure about the lincense though. It's a custom license which requires attribution but can be used in commercial products as well.


- topfs2 - 2010-11-26

Montellese Wrote:What about ImageMagick? Ok it might be a bit of an overkill but it can do all kinds of conversions very easily. I'm not sure about the lincense though. It's a custom license which requires attribution but can be used in commercial products as well.

http://trac.xbmc.org/ticket/8992 Smile Short story, its done on linux but win32 is being the usual bitch.

At any rate, it was discussed on devcon and I've began work with using freeimage (really low dependency and works on most platforms already). My progress can be followed https://github.com/topfs2/xbmc/tree/freeimage


- Montellese - 2010-11-26

topfs2 Wrote:http://trac.xbmc.org/ticket/8992 Smile Short story, its done on linux but win32 is being the usual bitch.
Hm ok I have already used ImageMagick in Win32 but always as a DLL. Maybe I can look into it and figure it out. But I can't test on OSX either (or does it work there already?)

topfs2 Wrote:At any rate, it was discussed on devcon and I've began work with using freeimage (really low dependency and works on most platforms already). My progress can be followed https://github.com/topfs2/xbmc/tree/freeimage
That would have been my second proposal ;-) I used FreeImage when I wanted a really small image library.


- topfs2 - 2010-11-26

Montellese Wrote:Hm ok I have already used ImageMagick in Win32 but always as a DLL. Maybe I can look into it and figure it out. But I can't test on OSX either (or does it work there already?)

If you could on win32 that would be awesome. For osx I think its less of a headache, not perfect but its closer to linux and just have some weird dependencies which we need to get rid off (should be fine if we compile it ourself)

That would have been my second proposal ;-) I used FreeImage when I wanted a really small image library.[/quote]

Yeah its quite good, I really dislike the windows API they use though but if we choose to use it patching that away and sending it upstream is probably something they will like also.


albumpath.... - giftie - 2010-11-27

I also store my music that way and each part(or cd) will get the matching cdART(as they often have different artwork between multiple discs).

I have added a couple of JSON calls to my script already and found it really has increased the speed of the database search(even though a direct query only takes about 2mins to retrieve the info from my music library of about 400 Album Artists and 1400 Albums.)

If I can get the path from the song, it would probably be one extra step. I'll look into it an see where I can get. I do like the fact I can get almost all the information from a single call(GetAlbumDetails).

I'm not surprised that you haven't had much of a chance to check out cdART, you developers have been working hard to produce such an excellent media system. I think of cdART another 'Look at what we can do' what showcases XBMC is. I think cdART was created during a feature freeze and the skinners have done an excellent job of creating a stable feature. I guess cdART is somewhat similar to how FanArt started...


I'll look into grabbing the Album path from the song info...

Thanks..


- marksoccer - 2010-11-28

How can I remove files from the current playlist? I can jump to a file in the playlist by using AudioPlaylist.Play with an index. However, when I use AudioPlaylist.Remove with an index, nothing happens. I also tried Playlist.Remove with no luck. Has this feature been implemented yet?


- grywnn - 2010-11-29

marksoccer Wrote:How can I remove files from the current playlist? I can jump to a file in the playlist by using AudioPlaylist.Play with an index. However, when I use AudioPlaylist.Remove with an index, nothing happens. I also tried Playlist.Remove with no luck. Has this feature been implemented yet?

+1 for this.
Although i see a CAVPlaylistOperations::Remove in AVPlaylistOperations.cpp, i get a "Method not found" when trying to call AudioPlaylist.Remove in RC1