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)



- dann0 - 2011-08-12

topfs2 Wrote: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.

I like the way you're thinking here, that flag you mention (your topic tangent) would also be useful when using GetAlbums();

Bear in mind that if you implement as you suggest, you will probably still want 'various' to appear in the list when calling GetArtist(album_artist=false), couple that with a parameter you could pass to GetAlbums() that forced it to return only VA albums and you would have good control of your Various Artist albums.

something like

GetAlbums(VA_only = true);


- jasonvp - 2011-08-19

Hi Guys,

Can "artistid","albumid","genreid" be added to "Audio.Fields.Song"?

Or is it only possible to use "musicbrainz" for multiple id requests?


Cheers
Jason


- topfs2 - 2011-08-19

jasonvp Wrote:Hi Guys,

Can "artistid","albumid","genreid" be added to "Audio.Fields.Song"?

Or is it only possible to use "musicbrainz" for multiple id requests?


Cheers
Jason

Please feature request it and cc me and montellese, I'm not sure how easily its done but its surely a valid feature!


- jasonvp - 2011-08-19

topfs2 Wrote:Please feature request it and cc me and montellese, I'm not sure how easily its done but its surely a valid feature!

Thanks topfs2.

Ticket #11863

I have some other JSON RPC request...well quite a few. Should I submit a feature for each individually or keep them in groups e.g. AudioPlaylist, Input, AudioPlayer etc or just one big list?


Cheers
Jason


- Montellese - 2011-08-28

jasonvp Wrote:Thanks topfs2.

Ticket #11863

I have some other JSON RPC request...well quite a few. Should I submit a feature for each individually or keep them in groups e.g. AudioPlaylist, Input, AudioPlayer etc or just one big list?


Cheers
Jason

Hey jason

Please create one feature request ticket for every single idea/request. That makes it much easier for us to integrate them seperately. You can always post a link to a related ticket in the description of a new ticket if needed. Please always remember to CC topfs2 and me in the tickets so we get notified about your requests.


- dann0 - 2011-09-01

nevermind


- Montellese - 2011-09-01

Hey everyone

For the ones wondering why not much has happend in the JSONRPC department during the last few weeks here are finally some updates. I was on a long holiday trip but now I'm back in the game and working hard on improving JSONRPC again.

Commits: ae691d390c87365087ff, 491764e6aa4f8a96ab7b
  • Added optional parameter "albumartistsonly" to AudioLibrary.GetArtists. If the parameter is not passed or is passed with a value of null the result will consider the GUI setting "Include artists who appear only on compilations" (Settings -> Music -> Library). Providing the parameter with a boolean value (true/false) overrides the GUI setting. If the GUI setting is unchecked or the parameter is passed with a value of false, the returned list will contain an artist named "Various artists". That artist has an "artistid" which cannot be used in AudioLibrary.GetArtistDetails but it can be used in AudioLibrary.GetAlbums and AudioLibrary.GetSongs.
  • Changed the return value of the "set" field, which can be requested for movies. Up until now the return value was a comma-seperated string of set names. It has now been changed into an array of set names which should make parsing the sets a lot easier for clients.
  • The following optional fields have been added to some media objects:
    • "setid" to movies
    • "tvshowid" to episodes
    • "artistid" to albums
    • "artistid" and "albumid" to songs
    This will make it easier to access "parent objects" of a retrieved media objects.



- rflores2323 - 2011-09-01

Hey guys.. this thread is way over my head however I am having trouble with xbmc connecting to remote server. I get a pop up when I start xbmc that shows this.

download log here XBMC log

Code:
NOTICE: Trakt Utilities: [Notification Service] Telnet too soon? (61) Connection refused

I just updated to the latest atv2 build built on sept 1 a and still the problem is there. Any help please.

I have all the below settings enabled in my network settings.

Share video and music libraries through UPnP

Allow control of XBMC via UPnP

Allow control of XBMC via HTTP

- Port

- Username

- Password

Web interface

Allow programs on this system to control XBMC

Allow programs on other systems to control XBMC


- samdret - 2011-09-01

Is there a way to get a database identifier based on a filename? Because when XBMC.Play is utilized with a filename, the info returned by System.GetInfoLabels differs from when that same file is played via XBMC (presumably via id).


- Montellese - 2011-09-01

rflores2323 Wrote:Hey guys.. this thread is way over my head however I am having trouble with xbmc connecting to remote server. I get a pop up when I start xbmc that shows this.

download log here XBMC log

Code:
NOTICE: Trakt Utilities: [Notification Service] Telnet too soon? (61) Connection refused

Did you change the default port (9090) of XBMC's TCP server in your advancedsettings or do you have any other app running on your atv2 that is using port 9090? Because in the log it says which might be because that port is already in use:

Code:
18:03:08 T:221143040   DEBUG: Thread JSONRPC::CTCPServer 221143040 terminating
18:03:08 T:117059584   ERROR: JSONRPC Server: Failed to bind serversocket

samdret Wrote:Is there a way to get a database identifier based on a filename? Because when XBMC.Play is utilized with a filename, the info returned by System.GetInfoLabels differs from when that same file is played via XBMC (presumably via id).
Not directly but what you can try is to call Files.GetDirectory with the path to the directory in which your file is. You will also have to provide the media type of the file so that JSONRPC is able to check the right database for the details of the file.


- rflores2323 - 2011-09-02

Montellese Wrote:Did you change the default port (9090) of XBMC's TCP server in your advancedsettings or do you have any other app running on your atv2 that is using port 9090? Because in the log it says which might be because that port is already in use:

Code:
18:03:08 T:221143040   DEBUG: Thread JSONRPC::CTCPServer 221143040 terminating
18:03:08 T:117059584   ERROR: JSONRPC Server: Failed to bind serversocket

Montellese,

I do not have an adavancedsetting.xml setup on this atv2. how do I check what programs are running on port 9090.

I have three xbmcs in my house and all 3 of them have the exact settings enabled in network settings. They all three are setup with same username and password and to run on port 8080. Do I need to change this? Should I leave me main xbmc to run on port 8080 and change the others to run on different ports like 8090 and 8091?

maybe that is why Im getting an error. Wanted to check here before I changed it and then did a port forward on these ports. Thanks


- Montellese - 2011-09-02

Having multiple XBMC boxes shouldn't be a problem because a port always works together with an IP address and every one of your XBMC boxes must have a different IP address anyways.

To check what ports are being used on your atv2 you need to log into your atv2 over ssh and then run netstat -a which should provide you with a list of all TCP and UDP ports in use. I don't have an atv2 (or any other apple product) so I can't provide more detailed instructions.


- rflores2323 - 2011-09-02

Montellese Wrote:Having multiple XBMC boxes shouldn't be a problem because a port always works together with an IP address and every one of your XBMC boxes must have a different IP address anyways.

To check what ports are being used on your atv2 you need to log into your atv2 over ssh and then run netstat -a which should provide you with a list of all TCP and UDP ports in use. I don't have an atv2 (or any other apple product) so I can't provide more detailed instructions.

ok this is my output

Code:
login as: root
[email protected]'s password:
Apple-TV:~ root# netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp4       0     52  192.168.1.7.ssh        192.168.1.17.4196      ESTABLISHED
tcp4       0      0  localhost.websm        localhost.62756        ESTABLISHED
tcp4       0      0  localhost.62756        localhost.websm        ESTABLISHED
tcp4       0      0  localhost.websm        localhost.62755        ESTABLISHED
tcp4       0      0  localhost.62755        localhost.websm        ESTABLISHED
tcp4       0      0  *.websm                *.*                    LISTEN
tcp4       0      0  *.54798                *.*                    LISTEN
tcp4       0      0  *.51697                *.*                    LISTEN
tcp4       0      0  *.http-alt             *.*                    LISTEN
tcp4       0      0  *.afs3-fileserver      *.*                    LISTEN
tcp4       0      0  *.daap                 *.*                    LISTEN
tcp4       0      0  *.vnc-server           *.*                    LISTEN
tcp4       0      0  *.49152                *.*                    LISTEN
tcp4       0      0  *.62078                *.*                    LISTEN
tcp4       0      0  *.ssh                  *.*                    LISTEN
udp4       0      0  *.ssdp                 *.*
udp4       0      0  *.9777                 *.*
udp4       0      0  *.*                    *.*
udp4       0      0  192.168.1.7.ntp        *.*
udp4       0      0  *.58441                *.*
udp4       0      0  *.*                    *.*
udp4       0      0  *.*                    *.*
udp4       0      0  *.53529                *.*
udp4       0      0  *.mdns                 *.*
udp4       0      0  localhost.ntp          *.*
udp4       0      0  *.ntp                  *.*
Active LOCAL (UNIX) domain sockets
Address  Type   Recv-Q Send-Q    Inode     Conn     Refs  Nextref Addr
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       4096   2048        0 84427850        0 84427868
       0 #0       4096   2048        0 84427098        0 844270b0
       0 #0       4096   2048        0 84427be0        0 84427bf8
       0 #0       4096   2048        0 84603980        0 84603998
       0 #0       4096   2048        0 840e2720        0 840e2738
       0 #0       4096   2048        0 840e24c0        0 840e24d8
       0 #0       4096   2048        0 840e2ed8        0 840e2ef0
       0 #0       4096   2048        0 82ca2688        0 82ca26a0
       0 #0       4096   2048        0 840e2b48        0 840e2b60
       0 #0       4096   2048        0 840e2428        0 840e2440
Apple-TV:~ root#



- Montellese - 2011-09-02

rflores2323 Wrote:ok this is my output

Code:
[...]
tcp4       0      0  *.websm                *.*                    LISTEN
[...]

I'm not 100% sure but this one is probably the bad guy. IIRC WebSM uses TCP port 9090. Did you run netstat while XBMC was running or without it running? Can you run netstat again without XBMC running and this time please execute "netstat -ln". This will only show the listening ports and it will resolve all those odd names into real port numbers. Then we should see for certain whether "websm" is the name of port 9090 or not.


- rflores2323 - 2011-09-02

Montellese Wrote:I'm not 100% sure but this one is probably the bad guy. IIRC WebSM uses TCP port 9090. Did you run netstat while XBMC was running or without it running? Can you run netstat again without XBMC running and this time please execute "netstat -ln". This will only show the listening ports and it will resolve all those odd names into real port numbers. Then we should see for certain whether "websm" is the name of port 9090 or not.

I was running xbmc before. Closed it and did what you said above. here you go below.

Code:
login as: root
[email protected]'s password:
Apple-TV:~ root# netstat -ln
Active Internet connections
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp4       0     52  192.168.1.7.22         192.168.1.17.3872      ESTABLISHED
udp4       0      0  192.168.1.7.123        *.*
udp4       0      0  *.64240                *.*
udp4       0      0  *.*                    *.*
udp4       0      0  *.*                    *.*
udp4       0      0  *.*                    *.*
udp4       0      0  *.62980                *.*
udp4       0      0  *.5353                 *.*
udp4       0      0  127.0.0.1.123          *.*
udp4       0      0  *.123                  *.*
Active LOCAL (UNIX) domain sockets
Address  Type   Recv-Q Send-Q    Inode     Conn     Refs  Nextref Addr
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       8192   8192        0        0        0        0
       0 #0       4096   2048        0 8458e980        0 8458e998
       0 #0       4096   2048        0 8458e8e8        0 8458e900
       0 #0       4096   2048        0 83fc1ab0        0 83fc1ac8
       0 #0       4096   2048        0 84382be0        0 84382bf8
       0 #0       4096   2048        0 835df558        0 835df570
       0 #0       4096   2048        0 8458eab0        0 8458eac8
       0 #0       4096   2048        0 83fc1980        0 83fc1998
       0 #0       4096   2048        0 83fc1be0        0 83fc1bf8
       0 #0       4096   2048        0 83fc1260        0 83fc1278
       0 #0       4096   2048        0 83fc14c0        0 83fc14d8
       0 #0       4096   2048        0 84382260        0 84382278
       0 #0       4096   2048        0 84382000        0 84382018
Apple-TV:~ root#