![]() |
|
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version +- XBMC Community Forum (http://forum.xbmc.org) +-- Forum: Development (/forumdisplay.php?fid=32) +--- Forum: Development (/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (/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 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
- jimk72 - 2011-11-29 04:31 Quick question: When I was parsing the playlist files and extracting items and sending them to xbmc through json it does not work when I send local files? example: smb://FREENAS/Music/AC_DC/AC_DC Live/Thunderstruck.mp3 adds to playlist fine but local files from a m3u file do not? H:\Music\3 Doors Down\When You're Young\When You're Young.mp3 gives an error about incorrect params? These are both from the same m3u file. Just figured out I can get the files from a playlist through json and local files are as follows: H:\\Music\\3 Doors Down\\When You're Young\\When You're Young.mp3 is this the format I need to send to add local files to playlist? - Montellese - 2011-11-29 10:20 el_Paraguayo Wrote:Also meant to ask, is there a "random" sort order? Databases don't support random ordering so XBMC would have to implement it manually is well which means XBMC would have to retrieve all movies as well and then randomly sort them which is almost the same as when you have to do it in your script. - Montellese - 2011-11-29 10:22 jimk72 Wrote:Quick question: When I was parsing the playlist files and extracting items and sending them to xbmc through json it does not work when I send local files? The double backslash is needed in JSON because a backslash is an escape character (e.g. to escape double-quotes (") within a string) so you have to escape the backslash with another backslash. If you don't do that the JSON parser tries to interprete \M, \3 and \W (in the specific case of the path you posted) as special characters which will end up with an invalid path. - Tolriq - 2011-11-29 10:54 Montellese Wrote:Databases don't support random ordering so XBMC would have to implement it manually is well which means XBMC would have to retrieve all movies as well and then randomly sort them which is almost the same as when you have to do it in your script. SQLLite or Mysql support random sorting very well ![]() And both with the same syntax : PHP Code: ORDER BY RAND() - el_Paraguayo - 2011-11-29 11:11 Montellese Wrote:Databases don't support random ordering so XBMC would have to implement it manually is well which means XBMC would have to retrieve all movies as well and then randomly sort them which is almost the same as when you have to do it in your script. That's fine. I just wanted to check I wasn't doing something that could be done by adding an extra parameter to my request! - Montellese - 2011-11-29 12:06 Tolriq Wrote:SQLLite or Mysql support random sorting very well I didn't mean SQLite or MySQL but our VideoDatabase and MusicDatabase but I can see that my statement was not very well phrased. We don't do the sorting through SQL because in many cases it isn't that easily possible (for example when "ignorearticle" is used) so if we want to provide a random sort we'll have to implement it manually as well. - jimk72 - 2011-11-29 17:23 Montellese Wrote:The double backslash is needed in JSON because a backslash is an escape character (e.g. to escape double-quotes (") within a string) so you have to escape the backslash with another backslash. If you don't do that the JSON parser tries to interprete \M, \3 and \W (in the specific case of the path you posted) as special characters which will end up with an invalid path. That was it! All playlists are selectable/viewable and playable now without any custom parsing from remote! I also noticed my smart playlists that have random will return a random order of the selected songs! You guys are doing one hellofa job!! Im amazed at how fast it works. Most playlists are instantly loaded with zero delay. - darwin - 2011-11-30 00:46 I'm confused about how to use Player.Open. I checked the wiki but it just says "mixed" for the parameters. I introspected and I saw that there's a path parameter to Player.Open, and I am trying to use it like so.. Code: {"params": {"path": "smb://192.168.0.200/path/to/my/file.avi"}, "jsonrpc": "2.0", "method": "Player.Open"}Doesn't seem to work and doesn't give any JSON response. Also doesn't log anything in the debug log at level 2. Player.Open takes a "path" argument, does that replace the former "file" argument of XBMC.Play? I feel like I'm missing something obvious... EDIT : Hey, jimk72's post below me answers my question! I guess it takes a Playlist.Item object.. which makes sense! yay! - jimk72 - 2011-11-30 02:24 Might have bug. If I use {"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"file":"special://profile/playlists/music/playlist.m3u"}},"id":1} It loads into the playlistid 1? the playlist contains only 3 songs. but if I do {"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"file":"special://profile/playlists/music/playlist.xsp"}},"id":1} A smart playlist of only songs, It loads it into playlistid 0. Getplaylists displays: {"id":3,"jsonrpc":"2.0","result":[{"playlistid":0,"type":"audio"},{"playlistid":1,"type":"video"},{"playlistid":2,"type":"picture"}]} Active player returns: {"id":1,"jsonrpc":"2.0","result":[{"playerid":0,"type":"audio"}]} for both of the above. There is no way to tell if playlist 1 or playlist 0 is playing? Which you need to know if you want to use playlist.add - Montellese - 2011-11-30 09:51 jimk72 Wrote:Might have bug. It's not really a bug because that's how XBMC works. If it has to create a playlist from multiple files it (by default) creates a video playlist unless there is some specific meta data that can be retrieved that specifies it as a music playlist (which is possible with smart playlists). This logic/implementation is far from perfect and I don't really know why it is done this way but that's how it is. If you want to know the playlistid of the playlist used by a player you can use Player.GetProperties and retrieve the "playlistid" property. |