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
|
- bartdesign - 2011-06-12 Thanks Topfs2, I've created an ticket: http://trac.xbmc.org/ticket/11629 I hope it get's implemented, it makes sense to include references back to the tv show. - Montellese - 2011-06-12 IMO it's a reasonable request and there are other such ID's which should be exposed. These are the ones I've identified so far: - "tvshowid" for episodes - "setid"s for movies in sets - "genreid"s for movies, tvshows, musicvideos, artists, albums and songs - "artistid" for albums and songs - "albumid" for songs If I missed something, please let me know. - bartdesign - 2011-06-13 Montellese Wrote:IMO it's a reasonable request and there are other such ID's which should be exposed. These are the ones I've identified so far: Looking good I've also looked through the introspect again but I can't think of any other ones that need to be included apart from the ones in your post. - Jason102 - 2011-06-14 Has the functionality of the Files.GetDirectory call changed? I use the call in PseudoTV to get all of the elements in a smart playlist. This no longer works, I only receive an empty list using the daily builds: Code: {"id":1,"jsonrpc":"2.0","result":{"files":null,"limits":{"end":0,"start":0,"total":0}}} Is this expected? Is there some new way to get smart playlist contents? - Montellese - 2011-06-14 Jason102 Wrote:Has the functionality of the Files.GetDirectory call changed? I use the call in PseudoTV to get all of the elements in a smart playlist. This no longer works, I only receive an empty list using the daily builds: Could you please provide your jsonrpc request? It might be that this broke during my re-write of how metadata for files is handled. - Jason102 - 2011-06-14 Quote:Could you please provide your jsonrpc request? Code: {"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "Smart Playlist Complete Path", "media": "video", "fields":["duration","runtime","tagline","showtitle","album","artist","plot"]}, "id": 1} - Montellese - 2011-06-14 Jason102 Wrote:Has the functionality of the Files.GetDirectory call changed? I use the call in PseudoTV to get all of the elements in a smart playlist. This no longer works, I only receive an empty list using the daily builds: You were right and I fixed it in this commit. Thanks for the report. Requesting currently playing audio? - doozer - 2011-06-17 Hi All, Appologies if this has already been answered, but search wouldn't narrow anything down other than somewhere in these 100+ pages! I have some of the basic JSON interface working and get an unsolicited notification when a new song starts playing: Code: {"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"speed":1,"type":"song"},"sender":"xbmc"}} Once I receive this i'm able to request the current position and track length, but what i'm struggling with is how to obtain the track title, artist, album and coverart? If figured "AudioLibrary.GetSongDetails" might help, but it needs a songid that I don't have. I'm using the bleeding edge build from last night of PRE-11.0. Thanks, Matt. - Montellese - 2011-06-17 Theoretically you should get the songid in the "id" field in the notification. How do you start playback of that song and is that song in your music library? There are a few situations where you won't get the ID of the song because it can't be retrieved but usually you should receive it with the notification. Another way of obtaining the currently playing song is to call AudioPlaylist.GetItems which contains a list of all songs that are in the current playlist. Furthermore there is a value called "current" which returns the index of the currently playing song which you can use to access the song from the list of songs in the current playlist. EDIT: Here's an example of what I get when I start playback of a song through the XBMC user interface: Code: { "jsonrpc": "2.0", "method": "Player.OnPlay", "params": { "data": { "id": 869, "speed": 1, "type": "song" }, "sender": "xbmc" }} - doozer - 2011-06-17 I am using my mouse directly on the XBMC PC to start the song playing. Should I be getting a songid in that case? Thanks for the quick reply. I'll give the GetItems a go. Montellese Wrote:Theoretically you should get the songid in the "id" field in the notification. How do you start playback of that song and is that song in your music library? There are a few situations where you won't get the ID of the song because it can't be retrieved but usually you should receive it with the notification. - Montellese - 2011-06-17 doozer Wrote:I am using my mouse directly on the XBMC PC to start the song playing. The only way I can think of right now which won't give you the songid is if you start the song from RecentlyAdded on your home screen or if it is not part of your library. But IIRC in both those cases you should get "type": "unknown" and not "type": "song". I'll have to try later if I can reproduce such a problem. Are you starting playback of a whole album/artist or a single song? - Montellese - 2011-06-17 The only way I could reproduce your notification without the "id" field is by starting playback of a song through a plugin like Last.FM which obviously plays songs which are not in the database. Starting playback of a whole album or artist returns no "id" and "type": "unknown" (I'll see if I can at least return "type": "song" for these though). - doozer - 2011-06-17 I added a network folder (SMB) that has about half a dozen albums in it. From the home menu I selected "Music". Browsed into the 2nd album in the list. Single clicked track 3. This played track 3 and then the rest of the album. During my JSON testing I was mostly hitting pause on the current song then play (to continue the song) which would trigger the OnPlay notification. No black magic involved Montellese Wrote:The only way I can think of right now which won't give you the songid is if you start the song from RecentlyAdded on your home screen or if it is not part of your library. But IIRC in both those cases you should get "type": "unknown" and not "type": "song". I'll have to try later if I can reproduce such a problem. - doozer - 2011-06-17 Nope not using any Internet based services - the mp3's are on my LAN. I get the same OnPlay notification if I navigate and start the song via Input.Select. Do I need to change any settings via JSONRPC.SetNotificationFlags? Montellese Wrote:The only way I could reproduce your notification without the "id" field is by starting playback of a song through a plugin like Last.FM which obviously plays songs which are not in the database. - doozer - 2011-06-17 Using AudioPlaylist.GetItems seems to only give you the filename (or label) as XBMC calls it of the songs. Is there a way to obtain the full info: Artist, Album, Coverart, Song name etc? Thanks, Matt. |