JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC

  Thread Rating:
  • 7 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Tolriq Offline
Member+
Posts: 1,833
Joined: Jun 2009
Reputation: 52
Location: France
Post: #1681
With basic i mean a little more than arrows Smile

Like context menu, go to home / video or such screens / info .... the actions that are mappable in keymaps.

Yatse 2 : Media Center Remote Control for Touch Screens
Yatse, the Xbmc Remote and Widgets for Android
find quote
doozer Offline
Junior Member
Posts: 32
Joined: Jun 2011
Reputation: 0
Post: #1682
Any chance Eden can be updated to send an unsolicited message when the user changes the "Repeat" setting (off/one/all) ?

Noticed in Eden Beta 3, changing this setting doesn't result in a Player.Repeat update being broadcast.

Thanks,
Matt.
(This post was last modified: 2012-02-10 05:47 by doozer.)
find quote
doozer Offline
Junior Member
Posts: 32
Joined: Jun 2011
Reputation: 0
Post: #1683
Hi All,

Hoping an expert can weigh in here and tell me if i'm doing something wrong..

I am listing all Genres:
Code:
{"jsonrpc": "2.0", "method": "AudioLibrary.GetGenres", "params": {"properties": ["title"], "limits": { "start" : 0, "end" : 20 }, "sort": { "method" : "label", "order" : "ascending" }}, "id": "AudioLibrary.GetGenres"}

Which results in:
Code:
{"id":"AudioLibrary.GetGenres","jsonrpc":"2.0","result":{"genres":[{"genreid":6,"label":"Alternative","title":"Alternative"},{"genreid":2,"label":"Hip-Hop","title":"Hip-Hop"},{"genreid":5,"label":"Punk","title":"Punk"},{"genreid":4,"label":"Rock","title":"Rock"},{"genreid":3,"label":"Unknown","title":"Unknown"}],"limits":{"end":5,"start":0,"total":5}}}

Note that the "Alternative" genre has an ID of 6.
I then request all Albums that fit this genre:
Code:
{"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbums", "params": {"genreid": 6,"properties": ["artist","artistid","albumlabel","year","thumbnail","genre"], "limits": { "start" : 0, "end" : 20 }, "sort": { "method" : "label", "order" : "ascending" }}, "id": "AudioLibrary.GetAlbumsByGenre"}

And get:
Code:
{"id":"AudioLibrary.GetAlbumsByGenre","jsonrpc":"2.0","result":{"albums":[{"albumid":9,"albumlabel":"WEA","artist":"Green Day","artistid":7,"genre":"Punk","label":"Dookie","thumbnail":"special://masterprofile/Thumbnails/Music/d/daca1175.tbn","year":1994},{"albumid":12,"albumlabel":"Reprise","artist":"Green Day","artistid":7,"genre":"Alternative","label":"Warning","thumbnail":"special://masterprofile/Thumbnails/Music/2/29036724.tbn","year":2000}],"limits":{"end":2,"start":0,"total":2}}}

Notice how I get one album of genre "Punk" and one of "Alternative". Why?
find quote
Montellese Offline
Team-XBMC Developer
Posts: 2,790
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #1684
doozer Wrote:Any chance Eden can be updated to send an unsolicited message when the user changes the "Repeat" setting (off/one/all) ?

Noticed in Eden Beta 3, changing this setting doesn't result in a Player.Repeat update being broadcast.
Same goes for shuffle and other settings. But I'm not gonna add any new stuff to the JSON-RPC API for Eden at this point in the release cycle. Please create a feature request ticket for it on trac so I won't forget once Eden is out.

doozer Wrote:Hi All,

Hoping an expert can weigh in here and tell me if i'm doing something wrong..

I am listing all Genres:
Code:
{"jsonrpc": "2.0", "method": "AudioLibrary.GetGenres", "params": {"properties": ["title"], "limits": { "start" : 0, "end" : 20 }, "sort": { "method" : "label", "order" : "ascending" }}, "id": "AudioLibrary.GetGenres"}

Which results in:
Code:
{"id":"AudioLibrary.GetGenres","jsonrpc":"2.0","result":{"genres":[{"genreid":6,"label":"Alternative","title":"Alternative"},{"genreid":2,"label":"Hip-Hop","title":"Hip-Hop"},{"genreid":5,"label":"Punk","title":"Punk"},{"genreid":4,"label":"Rock","title":"Rock"},{"genreid":3,"label":"Unknown","title":"Unknown"}],"limits":{"end":5,"start":0,"total":5}}}

Note that the "Alternative" genre has an ID of 6.
I then request all Albums that fit this genre:
Code:
{"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbums", "params": {"genreid": 6,"properties": ["artist","artistid","albumlabel","year","thumbnail","genre"], "limits": { "start" : 0, "end" : 20 }, "sort": { "method" : "label", "order" : "ascending" }}, "id": "AudioLibrary.GetAlbumsByGenre"}

And get:
Code:
{"id":"AudioLibrary.GetAlbumsByGenre","jsonrpc":"2.0","result":{"albums":[{"albumid":9,"albumlabel":"WEA","artist":"Green Day","artistid":7,"genre":"Punk","label":"Dookie","thumbnail":"special://masterprofile/Thumbnails/Music/d/daca1175.tbn","year":1994},{"albumid":12,"albumlabel":"Reprise","artist":"Green Day","artistid":7,"genre":"Alternative","label":"Warning","thumbnail":"special://masterprofile/Thumbnails/Music/2/29036724.tbn","year":2000}],"limits":{"end":2,"start":0,"total":2}}}

Notice how I get one album of genre "Punk" and one of "Alternative". Why?

I was confused at first as well but in general XBMC always operates on songs when using the audiolibrary so what it does when you retrieve all albums of a certain genre is it actually returns all albums which contain at least one song with that genre. So in you're case there should be at least one song in Green Day's Dookie album which has "Alternative" as a genre.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
doozer Offline
Junior Member
Posts: 32
Joined: Jun 2011
Reputation: 0
Post: #1685
Montellese Wrote:Same goes for shuffle and other settings. But I'm not gonna add any new stuff to the JSON-RPC API for Eden at this point in the release cycle. Please create a feature request ticket for it on trac so I won't forget once Eden is out.

I was confused at first as well but in general XBMC always operates on songs when using the audiolibrary so what it does when you retrieve all albums of a certain genre is it actually returns all albums which contain at least one song with that genre. So in you're case there should be at least one song in Green Day's Dookie album which has "Alternative" as a genre.

Will do.

Ah, I see, it's on a per song basis, not a per album. Makes sense. Thanks.
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,067
Joined: Nov 2011
Reputation: 19
Location: Nantes - France
Post: #1686
I'm using Files.GetDirectory for getting movies of a playlist :
Code:
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "special://profile/playlists/video/cartoons.xsp", "media": "video", "properties": ["originaltitle"], "sort": { "order": "descending", "method": "date" }}, "id": 1}')
I'm using sort to get last added movies but it doesn't seem to work because movies are returned in alphabetical order :
Code:
{u'jsonrpc': u'2.0',
u'id': 1,
u'result': {u'files': [{u'filetype': u'file', u'label': u"Winter's Bone", u'originaltitle': u"Winter's Bone", u'file': u'smb://READYNAS/media/Videos/HD/Films/Winter s bone/Winter s bone.mkv', u'type': u'movie', u'id': 75},
                        {u'filetype': u'file', u'label': u'Usual Suspects', u'originaltitle': u'The Usual Suspects', u'file': u'smb://READYNAS/media/Videos/HD/Films/The Usual Suspects/The Usual Suspects.mkv', u'type': u'movie', u'id': 70},
                        {u'filetype': u'file', u'label': u'Twilight - Chapitre 4 : R\xe9v\xe9lation 1\xe8re partie', u'originaltitle': u'Breaking Dawn - Part 1', u'file': u'smb://READYNAS/media/Videos/HD/Films/Twilight/Twilight - Chapitre 4 - Revelation 1ere partie/Twilight - Chapitre 4 - Revelation 1ere partie.m2ts', u'type': u'movie', u'id': 74},
                        {u'filetype': u'file', u'label': u'Twilight - Chapitre 3 : h\xe9sitation', u'originaltitle': u'Eclipse', u'file': u'smb://READYNAS/media/Videos/HD/Films/Twilight/Twilight - Chapitre 3 - Hesitation/Twilight III.mkv', u'type': u'movie', u'id': 73}
                       ],
             u'limits': {u'start': 0, u'total': 4, u'end': 4}
            }
}

How can I get movies from a playlist sorted by date ?

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

find quote
Montellese Offline
Team-XBMC Developer
Posts: 2,790
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #1687
The sort method "date" does not mean the date the movie was added to the database. Those sort methods are a mess and very confusing (sorry for that) :-S

There's currently no way to automatically sort by date added. It was added to XBMC before the feature freeze but I didn't know about it and therefore it didn't make it into the JSON-RPC API for Eden. I'm not gonna change the API at this time anymore for Eden. But it will be available after Eden.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
mikebzh44 Offline
Posting Freak
Posts: 1,067
Joined: Nov 2011
Reputation: 19
Location: Nantes - France
Post: #1688
I was confused because before today, request seems to bo OK but today, I have completly rebuild my video data so every movies was added today.

I will see tomorrow, when I will add some new movies, what the request will return.

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

find quote
mikebzh44 Offline
Posting Freak
Posts: 1,067
Joined: Nov 2011
Reputation: 19
Location: Nantes - France
Post: #1689
When I am using VideoLibrary.GetRecentlyAddedMovies, I get only 25 movies but if I use VideoLibrary.GetMovies, I get 187 movies.

GetRecentlyAddedMovies is limited ?

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

find quote
Montellese Offline
Team-XBMC Developer
Posts: 2,790
Joined: Jan 2009
Reputation: 20
Location: Switzerland
Post: #1690
Yes as the name suggests by containing "Recently" Wink

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
Post Reply