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) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
- Tolriq - 2012-02-09 With basic i mean a little more than arrows Like context menu, go to home / video or such screens / info .... the actions that are mappable in keymaps. Player.Repeat - doozer - 2012-02-10 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. Genre issue - doozer - 2012-02-10 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? - Montellese - 2012-02-10 doozer Wrote:Any chance Eden can be updated to send an unsolicited message when the user changes the "Repeat" setting (off/one/all) ?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, 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. - doozer - 2012-02-11 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. Will do. Ah, I see, it's on a per song basis, not a per album. Makes sense. Thanks. - mikebzh44 - 2012-02-11 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}') Code: {u'jsonrpc': u'2.0', How can I get movies from a playlist sorted by date ? - Montellese - 2012-02-11 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. - mikebzh44 - 2012-02-11 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. - mikebzh44 - 2012-02-11 When I am using VideoLibrary.GetRecentlyAddedMovies, I get only 25 movies but if I use VideoLibrary.GetMovies, I get 187 movies. GetRecentlyAddedMovies is limited ? - Montellese - 2012-02-11 Yes as the name suggests by containing "Recently" - mikebzh44 - 2012-02-12 OK. I want to request movie database in order to populate widgets "Random movies" and "Last added movies" for custom menus based on playlists : http://forum.xbmc.org/showthread.php?tid=122448 There is no way to request database using SQL with JSON ? Is it possible to add a result (as Title, Rating, Plot, ...) in Video.Fields.Movie for retrieving "database date added" ? So list could be sort by python because JSON sort by date did not do what everybody expect :S - Montellese - 2012-02-12 No there is and will never be a way to use SQL queries through JSON-RPC. It's just too unsafe and a lot of things can go sideways. But there will be some kind of query functionality in the future. I can't add a "Database date added" property to the result because XBMC does not store such a thing. What XBMC does to retrieve the list of recently added movies is it simply sorts the result by movieid in a descending order. So you can do that with python as well. - mikebzh44 - 2012-02-12 Thanks for the tip of using ID !! I think you are my saver - ErlendSB - 2012-02-13 Montellese Wrote:No there is and will never be a way to use SQL queries through JSON-RPC. It's just too unsafe and a lot of things can go sideways. But there will be some kind of query functionality in the future.I'm sorry if this has been answered before. I can't seem to find any methods for querying the AudioLibrary on SongTitle. I wrote an addon that searches the library for songs matching a specific title. (LastFMPlaylistGenerator). I solve this today by using the HTTP api queryMusicDatabase. Will the JSPN RPC be extended to support these kinds of queries? - Montellese - 2012-02-13 Yes the most likely implementation will be to allow to provide queries in a similar way XBMC allows to define smartplaylists. So you will send a request to VideoLibrary.GetMovies and one of the parameters will be "filter" and it will take some kind of object which might contain something like Code: { "property": "title", "operator": "contains", "value": "Potter" } |