• 1
  • 209
  • 210
  • 211(current)
  • 212
  • 213
  • 226
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
(2014-03-18, 22:12)Tolriq Wrote: Just be sure that your file is in a source and not a random location as access is denied if it's not the case Wink

I figured out why it wasn't opening (I accidentally used 'path' instead of 'file', duh), but now i'm back to square one. File opens but doesn't seek or resume to given vaule. Even using your example:
Code:
{"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"smb://.....mkv"},"options":{"resume":{"hours":0,"minutes":8,"seconds":8,"milliseconds":0}}}}

File opens, but always starts at the beginning... This is the same behavior I observed while testing in Frodo.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
Can someone knowledgeable in Json try:

Code:
{"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"smb://.....mkv"},"options":{"resume":{"hours":0,"minutes":8,"seconds":8,"milliseconds":0}}}}

I know it returns "ok" but does it actually seek to the set resume point?
From my experience it simply plays the file without seeking...

Thanks

::Update::

Nevermind, I figured it out. It was a problem of how the commands were stacked together and nested...
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
Does lastplayed value is not available for GetDirectory function ?

Code:
11:59:28 T:2924   DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "special://profile/playlists/video/Cartoons.xsp", "media": "video", "properties": ["title", "originaltitle", "playcount", "year", "genre", "studio", "country", "tagline", "plot", "runtime", "file", "plotoutline", "lastplayed", "trailer", "rating", "resume", "art", "streamdetails", "mpaa", "director", "dateadded", "lastplayed"]}, "id": 1}
11:59:28 T:2924   DEBUG: JSONRPC: Not unique array element at index 12 and 21 in type Item.Fields.Base
11:59:28 T:2924   DEBUG: JSONRPC: Value does not match extended type Item.Fields.Base of type properties

Because this value is listed in List.Field.Files, according to the wiki :

http://wiki.xbmc.org/index.php?title=JSO...tDirectory

http://wiki.xbmc.org/index.php?title=JSO...elds.Files

Thanks.
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
(2014-03-24, 13:09)mikebzh44 Wrote: Does lastplayed value is not available for GetDirectory function ?

Code:
11:59:28 T:2924   DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "special://profile/playlists/video/Cartoons.xsp", "media": "video", "properties": ["title", "originaltitle", "playcount", "year", "genre", "studio", "country", "tagline", "plot", "runtime", "file", "plotoutline", "lastplayed", "trailer", "rating", "resume", "art", "streamdetails", "mpaa", "director", "dateadded", "lastplayed"]}, "id": 1}
11:59:28 T:2924   DEBUG: JSONRPC: Not unique array element at index 12 and 21 in type Item.Fields.Base
11:59:28 T:2924   DEBUG: JSONRPC: Value does not match extended type Item.Fields.Base of type properties

Because this value is listed in List.Field.Files, according to the wiki :

http://wiki.xbmc.org/index.php?title=JSO...tDirectory

http://wiki.xbmc.org/index.php?title=JSO...elds.Files

Thanks.

Please read the output provided by XBMC. It tells you that the elements at index 12 and 21 in the array you provide are not unique. In your case both are "lastplayed" but the JSON-RPC API does not allow two elements with the same value. Remove one of them and you should be good.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
Oops, sorry :S
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
artistid and albumartistid are not retrieve with GetDirectory method and Songs or Albums smart playlists.

Playlist:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="songs">
    <name>Last Played Songs</name>
    <match>all</match>
    <rule field="lastplayed" operator="inthelast">
        <value>3 weeks</value>
    </rule>
    <order direction="ascending">lastplayed</order>
</smartplaylist>

Code:
_json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "music", "properties": ["artistid", "albumid", "albumartistid", "dateadded"]}, "id": 1}' %(PLAYLIST))
_json_query = unicode(_json_query, 'utf-8', errors='ignore')
_json_pl_response = json.loads(_json_query)
_files = _json_pl_response.get( "result", {} ).get( "files" )
print("_files=",_files)

Result :
Code:
('_files=', [{u'filetype': u'file', u'label': u'Do I Wanna Know?', u'albumid': 2, u'file': u'G:\\Musiques\\Arctic Monkeys\\2013 - AM\\01 - Arctic Monkeys - Do I Wanna Know-.mp3', u'type': u'song', u'id': 2360}, {u'filetype': u'file', u'label': u'Rolling into deep', u'albumid': 1, u'file': u'G:\\Musiques\\Adele\\2011 - 21\\01 Rolling in the Deep.mp3', u'type': u'song', u'id': 2347}])
Sorry for my english, but, you know, I'm French so ...

Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie
Reply
What property values will trigger a Player.OnPropertyChanged notification? The JSONRPC documentation lists a lot of properties like time, percentage, etc. But I don't see any OnPropertyChanged notifications coming in at all so I assume it can't return those values....
Reply
(2014-03-30, 21:09)wuench Wrote: What property values will trigger a Player.OnPropertyChanged notification? The JSONRPC documentation lists a lot of properties like time, percentage, etc. But I don't see any OnPropertyChanged notifications coming in at all so I assume it can't return those values....

Right now only "shuffled" and "repeat" AFAICT. The others are properties you can retrieve through Player.GetProperties.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
Ok, thanks. That's what I figured. I know I can retrieve that info through polling, and currently do. But my driver is pushing the CPU on my Raspberry Pi by about 10-15% polling every 3 seconds so I am trying to be a little more efficient on how I poll. OnPropertyChanged looked like it solved all my problems, but it looks like I will need to get more creative and fake the time tracking. I get why you wouldn't want to push that info out in events...
Reply
::edit::
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
Hi guys,
This is already working, right ?
Quote:November 11th 2013:
Commit: Commit:85bfca0
Add Settings namespace with GetSections, GetCategories, GetSettings, GetSettingValue, SetSettingValue and ResetSettingValue
Can you guys tell me if is working for Frodo too ?
Is there a place where i can read about it ?
Thanks
Clayton
Reply
It's not available in Frodo and there's no real documentation about it except of the API definition.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
Thanks Montellese
I the code bellow to get a description of the Settings.GetSettings
Quote:{"jsonrpc":"2.0","method":"JSONRPC.Introspect","params": {"getdescriptions": true,"filter":{"getreferences":true,"id":"Settings.GetSettings","type":"method"}},"id":1}
But now i am trying to get all values that i can use on the "section" and "category" fields, can i do that using JSONRPC.Introspect ?
For get the audio output value, the user joethefox already help me
Quote:{"jsonrpc":"2.0","method":"Settings.GetSettings", "params":{"filter":{"section":"system","category":"audiooutput"}},"id":1}
Thanks again
Clayton
Reply
You need to use Settings.GetSections to get a list of possible values for "section" and Settings.GetCategories to get a list of possible values for "category". Or you can look into XBMC's settings definition in your XBMC installation under system/settings/settings.xml to see what exists and what doesn't.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
Thanks Montellese, sorry, i was so tired when i wrote this question that i don´t read everything on the commit, now i know how it works, very cool.
Can you tell me if is already possible to request a image with a specific size ? I tried to found any information about this but i don´t found.
Thanks again
Best regards
Clayton
Reply
  • 1
  • 209
  • 210
  • 211(current)
  • 212
  • 213
  • 226

Logout Mark Read Team Forum Stats Members Help
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC8