| 1 | .\" |
| 2 | .\" Copyright (C) 2004-2011, 2013 Richard Kettlewell |
| 3 | .\" |
| 4 | .\" This program is free software: you can redistribute it and/or modify |
| 5 | .\" it under the terms of the GNU General Public License as published by |
| 6 | .\" the Free Software Foundation, either version 3 of the License, or |
| 7 | .\" (at your option) any later version. |
| 8 | .\" |
| 9 | .\" This program is distributed in the hope that it will be useful, |
| 10 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | .\" GNU General Public License for more details. |
| 13 | .\" |
| 14 | .\" You should have received a copy of the GNU General Public License |
| 15 | .\" along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | .\" |
| 17 | .TH disorder_protocol 5 |
| 18 | .SH NAME |
| 19 | disorder_protocol \- DisOrder communication protocol |
| 20 | .SH DESCRIPTION |
| 21 | The DisOrder client and server communicate via the protocol described |
| 22 | in this man page. |
| 23 | .PP |
| 24 | The protocol is usually modified in each new version of the server. |
| 25 | .SH "MESSAGE STRUCTURE" |
| 26 | A \fIline\fR is a sequence of printable Unicode characters encoded in UTF-8 and |
| 27 | terminated by the octet 0x0A. |
| 28 | Note that unlike some other protocols, a carriage return is not used as part of |
| 29 | the end-of-line sequence. |
| 30 | .PP |
| 31 | A \fIcommand message\fR consists of a \fIcommand line\fR followed, in some cases, by a \fIbody\fR. |
| 32 | Similarly a \fIresponse message\fR consists of a \fIresponse line\fR followed |
| 33 | sometimes by a \fIbody\fR. |
| 34 | .PP |
| 35 | A \fIbody\fR consists of a sequence of dot-stuffed lines followed by a line |
| 36 | containing a single full stop character. |
| 37 | Dot-stuffing means that any line in the body starting with a full stop have |
| 38 | another full stop inserted at the start prior to transmission, and removed |
| 39 | again after reception. |
| 40 | .PP |
| 41 | Whether a command message includes a body depends on the specific command being |
| 42 | sent; see below for details. |
| 43 | This is also true of reply messages, although it is guaranteed that if the is a |
| 44 | response body then the reply status code (see below) will end with the digit 3. |
| 45 | .PP |
| 46 | Command lines, and some response lines, are split into \fIfields\fR. |
| 47 | Fields are separated by one or more spaces and may be \fIunquoted\fR or |
| 48 | \fIquoted\fR. |
| 49 | .PP |
| 50 | An \fIunquoted field\fR can contain any (non-control) characters except for a |
| 51 | space, quotation mark or apostrophe. |
| 52 | They are always at least one character long. |
| 53 | .PP |
| 54 | A \fIquoted field\fR begins with a quotation mark or apostrophe and is |
| 55 | terminated by the same character. |
| 56 | Any occurrence of the backslash or the surrounding quotation mark must be |
| 57 | escaped. |
| 58 | The full set of escapes permitted is: |
| 59 | .TP |
| 60 | .B \e\e |
| 61 | Backslash |
| 62 | .TP |
| 63 | .B \e" |
| 64 | Quotation mark |
| 65 | .\" " |
| 66 | .TP |
| 67 | .B \e\(aq |
| 68 | Apostrophe |
| 69 | .TP |
| 70 | .B \en |
| 71 | Line feed |
| 72 | .PP |
| 73 | .SH COMMANDS |
| 74 | Commands always have a command name as the first field of the line. |
| 75 | .PP |
| 76 | All commands require the connection to have been already authenticated unless |
| 77 | stated otherwise. |
| 78 | See \fBAUTHENTICATION\fR below. |
| 79 | If not stated otherwise, the \fBread\fR right is sufficient to execute |
| 80 | the command. |
| 81 | .TP |
| 82 | .B adduser \fIUSERNAME PASSWORD \fR[\fIRIGHTS\fR] |
| 83 | Create a new user with the given username and password. |
| 84 | The new user's rights list can be specified; if it is not |
| 85 | then the \fBdefault_rights\fR setting applies instead. |
| 86 | Requires the \fBadmin\fR right, and only works on local |
| 87 | connections. |
| 88 | .TP |
| 89 | .B adopt \fIID\fR |
| 90 | Adopts a randomly picked track, leaving it in a similar state to if it was |
| 91 | picked by this user. Requires the \fBplay\fR right. |
| 92 | .TP |
| 93 | .B allfiles \fIDIRECTORY\fR [\fIREGEXP\fR] |
| 94 | List all the files and directories in \fIDIRECTORY\fR in a response body. |
| 95 | If \fIREGEXP\fR is present only matching files and directories are returned. |
| 96 | .TP |
| 97 | .B confirm \fICONFIRMATION |
| 98 | Confirm user registration. |
| 99 | \fICONFIRMATION\fR is as returned from \fBregister\fR below. |
| 100 | This command logs the user in. |
| 101 | The response contains the logged-in username. |
| 102 | .TP |
| 103 | .B cookie \fICOOKIE |
| 104 | Log a user back in using a cookie created with \fBmake\-cookie\fR. |
| 105 | The response contains the username. |
| 106 | .TP |
| 107 | .B deluser \fIUSERNAME |
| 108 | Delete the named user. |
| 109 | Requires the \fBadmin\fR right, and only works on local connections. |
| 110 | .TP |
| 111 | .B dirs \fIDIRECTORY\fR [\fIREGEXP\fR] |
| 112 | List all the directories in \fIDIRECTORY\fR in a response body. |
| 113 | If \fIREGEXP\fR is present only matching directories are returned. |
| 114 | .TP |
| 115 | .B disable \fR[\fBnow\fR] |
| 116 | Disable further playing. |
| 117 | If the optional \fBnow\fR argument is present then the current track |
| 118 | is stopped. |
| 119 | Requires the \fBglobal prefs\fR right. |
| 120 | .TP |
| 121 | .B edituser \fIUSERNAME PROPERTY VALUE |
| 122 | Set a user property. |
| 123 | With the \fBadmin\fR right any username and property may be specified. |
| 124 | Otherwise the \fBuserinfo\fR right is required and only the |
| 125 | \fBemail\fR and \fBpassword\fR properties may be set. |
| 126 | .IP |
| 127 | User properties are syntax-checked before setting. For instance \fBemail\fR |
| 128 | must contain an "@" sign or you will get an error. (Setting an empty value for |
| 129 | \fBemail\fR is allowed and removes the property.) |
| 130 | .IP |
| 131 | See \fBUSER PROPERTIES\fR below. |
| 132 | .TP |
| 133 | .B enable |
| 134 | Re-enable further playing, and is the opposite of \fBdisable\fR. |
| 135 | Requires the \fBglobal prefs\fR right. |
| 136 | .TP |
| 137 | .B enabled |
| 138 | Report whether playing is enabled. |
| 139 | The second field of the response line will be \fByes\fR or \fBno\fR. |
| 140 | .TP |
| 141 | .B exists \fITRACK\fR |
| 142 | Report whether the named track exists. |
| 143 | The second field of the response line will be \fByes\fR or \fBno\fR. |
| 144 | .TP |
| 145 | .B files \fIDIRECTORY\fR [\fIREGEXP\fR] |
| 146 | List all the files in \fIDIRECTORY\fR in a response body. |
| 147 | If \fIREGEXP\fR is present only matching files are returned. |
| 148 | .TP |
| 149 | .B get \fITRACK\fR \fIPREF\fR |
| 150 | Gets a preference value. |
| 151 | On success the second field of the response line will have the value. |
| 152 | .IP |
| 153 | If the track or preference do not exist then the response code is 555. |
| 154 | .TP |
| 155 | .B get\-global \fIKEY\fR |
| 156 | Get a global preference. |
| 157 | .IP |
| 158 | If the preference does not exist then the response code is 555. |
| 159 | .TP |
| 160 | .B length \fITRACK\fR |
| 161 | Get the length of the track in seconds. |
| 162 | On success the second field of the response line will have the value. |
| 163 | .TP |
| 164 | .B log |
| 165 | Send event log messages in a response body. |
| 166 | The command will never terminate. |
| 167 | Any further data sent to the server will be discarded (explicitly; |
| 168 | i.e. it will not accumulate in a buffer somewhere). |
| 169 | .IP |
| 170 | See \fBEVENT LOG\fR below for more details. |
| 171 | .TP |
| 172 | .B make\-cookie |
| 173 | Returns an opaque string that can be used by the \fBcookie\fR command to log |
| 174 | this user back in on another connection (until the cookie expires). |
| 175 | .TP |
| 176 | .B move \fITRACK\fR \fIDELTA\fR |
| 177 | Move a track in the queue. |
| 178 | The track may be identified by ID (preferred) or name (which might cause |
| 179 | confusion if it's there twice). |
| 180 | \fIDELTA\fR should be an negative or positive integer and indicates how |
| 181 | many steps towards the head of the queue the track should be moved. |
| 182 | .IP |
| 183 | Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights |
| 184 | depending on how the track came to be added to the queue. |
| 185 | .TP |
| 186 | .B moveafter \fITARGET\fR \fIID\fR ... |
| 187 | Move all the tracks in the \fIID\fR list after ID \fITARGET\fR. |
| 188 | If \fITARGET\fR is the empty string then the listed tracks are put |
| 189 | at the head of the queue. |
| 190 | If \fITARGET\fR is listed in the ID list then the tracks are moved |
| 191 | to just after the first non-listed track before it, or to the head if there is |
| 192 | no such track. |
| 193 | .IP |
| 194 | Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights |
| 195 | depending on how the tracks came to be added to the queue. |
| 196 | .TP |
| 197 | .B new \fR[\fIMAX\fR] |
| 198 | Send the most recently added \fIMAX\fR tracks in a response body. |
| 199 | If the argument is omitted, the \fBnew_max\fR most recent tracks are |
| 200 | listed (see \fBdisorder_config\fR(5)). |
| 201 | .TP |
| 202 | .B nop |
| 203 | Do nothing. |
| 204 | Used by |
| 205 | .BR disobedience (1) |
| 206 | as a keepalive measure. |
| 207 | This command does not require authentication. |
| 208 | .TP |
| 209 | .B part \fITRACK\fR \fICONTEXT\fI \fIPART\fR |
| 210 | Get a track name part. |
| 211 | Returns an empty string if a name part cannot be constructed. |
| 212 | .IP |
| 213 | .I CONTEXT |
| 214 | is one of |
| 215 | .B sort |
| 216 | or |
| 217 | .B display |
| 218 | and |
| 219 | .I PART |
| 220 | is usually one of |
| 221 | .BR artist , |
| 222 | .B album |
| 223 | or |
| 224 | .BR title . |
| 225 | .TP |
| 226 | .B pause |
| 227 | Pause the current track. |
| 228 | Requires the \fBpause\fR right. |
| 229 | .TP |
| 230 | .B play \fITRACK\fR |
| 231 | Add a track to the queue. |
| 232 | The response contains the queue ID of the track. |
| 233 | Requires the \fBplay\fR right. |
| 234 | .TP |
| 235 | .B playafter \fITARGET\fR \fITRACK\fR ... |
| 236 | Add all the tracks in the \fITRACK\fR list to the queue after \fITARGET\fR |
| 237 | (which should be a track ID). |
| 238 | If \fITARGET\fR is the empty string then the listed tracks are put |
| 239 | at the head of the queue. |
| 240 | .IP |
| 241 | Currently the success result does \fInot\fR include the new track IDs. |
| 242 | .IP |
| 243 | Requires the \fBplay\fR right. |
| 244 | .TP |
| 245 | .B playing |
| 246 | Report what track is playing. |
| 247 | .IP |
| 248 | If the response is \fB252\fR then the rest of the response line consists of |
| 249 | track information (see below). |
| 250 | .IP |
| 251 | If the response is \fB259\fR then nothing is playing. |
| 252 | .TP |
| 253 | .B playlist-delete \fIPLAYLIST\fR |
| 254 | Delete a playlist. |
| 255 | Requires permission to modify that playlist and the \fBplay\fR right. |
| 256 | .TP |
| 257 | .B playlist-get \fIPLAYLIST\fR |
| 258 | Get the contents of a playlist, in a response body. |
| 259 | Requires permission to read that playlist and the \fBread\fR right. |
| 260 | If the playlist does not exist the response is 555. |
| 261 | .TP |
| 262 | .B playlist-get-share \fIPLAYLIST\fR |
| 263 | Get the sharing status of a playlist. |
| 264 | The result will be \fBpublic\fR, \fBprivate\fR or \fBshared\fR. |
| 265 | Requires permission to read that playlist and the \fBread\fR right. |
| 266 | .TP |
| 267 | .B playlist-lock \fIPLAYLIST\fR |
| 268 | Lock a playlist. |
| 269 | Requires permission to modify that playlist and the \fBplay\fR right. |
| 270 | Only one playlist may be locked at a time on a given connection and the lock |
| 271 | automatically expires when the connection is closed. |
| 272 | .TP |
| 273 | .B playlist-set \fIPLAYLIST\fR |
| 274 | Set the contents of a playlist. |
| 275 | The new contents should be supplied in a command body. |
| 276 | Requires permission to modify that playlist and the \fBplay\fR right. |
| 277 | The playlist must be locked. |
| 278 | .TP |
| 279 | .B playlist-set-share \fIPLAYLIST\fR \fISHARE\fR |
| 280 | Set the sharing status of a playlist to |
| 281 | \fBpublic\fR, \fBprivate\fR or \fBshared\fR. |
| 282 | Requires permission to modify that playlist and the \fBplay\fR right. |
| 283 | .TP |
| 284 | .B playlist-unlock\fR |
| 285 | Unlock the locked playlist. |
| 286 | .TP |
| 287 | .B playlists |
| 288 | List all playlists that this connection has permission to read. |
| 289 | Requires the \fBread\fR right. |
| 290 | .TP |
| 291 | .B prefs \fBTRACK\fR |
| 292 | Send back the preferences for \fITRACK\fR in a response body. |
| 293 | Each line of the response has the usual line syntax, the first field being the |
| 294 | name of the pref and the second the value. |
| 295 | .TP |
| 296 | .B queue |
| 297 | Send back the current queue in a response body, one track to a line, the track |
| 298 | at the head of the queue (i.e. next to be be played) first. |
| 299 | See below for the track information syntax. |
| 300 | .TP |
| 301 | .B random\-disable |
| 302 | Disable random play (but don't stop the current track). |
| 303 | Requires the \fBglobal prefs\fR right. |
| 304 | .TP |
| 305 | .B random\-enable |
| 306 | Enable random play. |
| 307 | Requires the \fBglobal prefs\fR right. |
| 308 | .TP |
| 309 | .B random\-enabled |
| 310 | Report whether random play is enabled. |
| 311 | The second field of the response line will be \fByes\fR or \fBno\fR. |
| 312 | .TP |
| 313 | .B recent |
| 314 | Send back the current recently-played list in a response body, one track to a |
| 315 | line, the track most recently played last. |
| 316 | See below for the track information syntax. |
| 317 | .TP |
| 318 | .B reconfigure |
| 319 | Request that DisOrder reconfigure itself. |
| 320 | Requires the \fBadmin\fR right. |
| 321 | .IP |
| 322 | Not all configuration options can be modified during the lifetime of the |
| 323 | server; of those that can't, some will just be ignored if they change while |
| 324 | others will cause the new configuration to be rejected. |
| 325 | See \fBdisorder_config\fR(5) for details. |
| 326 | .TP |
| 327 | .B register \fIUSERNAME PASSWORD EMAIL |
| 328 | Register a new user. |
| 329 | Requires the \fBregister\fR right. |
| 330 | The result contains a confirmation string; the user will be be able |
| 331 | to log in until this has been presented back to the server via the |
| 332 | \fBconfirm\fR command. |
| 333 | .TP |
| 334 | .B reminder \fIUSERNAME\fR |
| 335 | Send a password reminder to user \fIUSERNAME\fR. |
| 336 | If the user has no valid email address, or no password, or a |
| 337 | reminder has been sent too recently, then no reminder will be sent. |
| 338 | .TP |
| 339 | .B remove \fIID\fR |
| 340 | Remove the track identified by \fIID\fR. |
| 341 | Requires one of the \fBremove mine\fR, \fBremove random\fR or |
| 342 | \fBremove any\fR rights depending on how the |
| 343 | track came to be added to the queue. |
| 344 | .TP |
| 345 | .B rescan \fR[\fBwait\fR] \fR[\fBfresh\fR] |
| 346 | Rescan all roots for new or obsolete tracks. |
| 347 | Requires the \fBrescan\fR right. |
| 348 | .IP |
| 349 | If the \fBwait\fR flag is present then the response is delayed until the rescan |
| 350 | completes. |
| 351 | Otherwise the response arrives immediately. |
| 352 | This is primarily intended for testing. |
| 353 | .IP |
| 354 | If the \fBfresh\fR flag is present a rescan is already underway then a second |
| 355 | rescan will be started when it completes. |
| 356 | The default behavior is to piggyback on the existing rescan. |
| 357 | .IP |
| 358 | NB that \fBfresh\fR is currently disabled in the server source, so using this |
| 359 | flag will just provoke an error. |
| 360 | .TP |
| 361 | .B resolve \fITRACK\fR |
| 362 | Resolve a track name, i.e. if this is an alias then return the real track name. |
| 363 | .TP |
| 364 | .B resume |
| 365 | Resume the current track after a \fBpause\fR command. |
| 366 | Requires the \fBpause\fR right. |
| 367 | .TP |
| 368 | .B revoke |
| 369 | Revoke the current login's cookie. |
| 370 | It will not be possible to use the cookie in the future. |
| 371 | .TP |
| 372 | .B rtp\-address |
| 373 | Report the RTP broadcast (or multicast) address, in the form \fIADDRESS |
| 374 | PORT\fR. |
| 375 | If the server is in RTP request mode then the result is \fB- -\fR. |
| 376 | This command does not require authentication. |
| 377 | .TP |
| 378 | .B rtp\-cancel |
| 379 | Cancel the unicast RTP stream associated with this connection. |
| 380 | .TP |
| 381 | .B rtp\-request \fIADDRESS PORT\fR |
| 382 | Request that an RTP stream be transmitted to a given destination address. |
| 383 | Only one unicast stream may be requested per connection. |
| 384 | WHen the connection is closed the stream is terminated. |
| 385 | .TP |
| 386 | .B scratch \fR[\fIID\fR] |
| 387 | Remove the track identified by \fIID\fR, or the currently playing track if no |
| 388 | \fIID\fR is specified. |
| 389 | Requires one of the \fBscratch mine\fR, \fBscratch random\fR or |
| 390 | \fBscratch any\fR rights depending on how the track came to be |
| 391 | added to the queue. |
| 392 | .TP |
| 393 | .B schedule-add \fIWHEN\fR \fIPRIORITY\fR \fIACTION\fR ... |
| 394 | Schedule an event for the future. |
| 395 | .IP |
| 396 | .I WHEN |
| 397 | is the time when it should happen, as a timestamp. |
| 398 | See \fBTIMESTAMPS\fR below. |
| 399 | It must refer to a time in the future. |
| 400 | .IP |
| 401 | .I PRIORITY |
| 402 | is the event priority. |
| 403 | This can be \fBnormal\fR, in which case the event will be run at startup if its |
| 404 | time has past, or \fBjunk\fR in which case it will be discarded if it is found |
| 405 | to be in the past at startup. |
| 406 | The meaning of other values is not defined. |
| 407 | .IP |
| 408 | .I ACTION |
| 409 | is the action to perform. |
| 410 | The choice of action determines the meaning of the remaining arguments. |
| 411 | Possible actions are: |
| 412 | .RS |
| 413 | .TP |
| 414 | .B play |
| 415 | Play a track. |
| 416 | The next argument is the track name. |
| 417 | Requires the \fBplay\fR right. |
| 418 | .TP |
| 419 | .B set-global |
| 420 | Set a global preference. |
| 421 | The next argument is the preference name and the final argument is the value to |
| 422 | set it to (omit it to unset it). |
| 423 | Requires the \fBglobal prefs\fR right. |
| 424 | .RE |
| 425 | .IP |
| 426 | You need the right at the point you create the event. |
| 427 | It is not possible to create scheduled events in expectation of a future change |
| 428 | in rights. |
| 429 | .TP |
| 430 | .B schedule-del \fIEVENT\fR |
| 431 | Deletes a scheduled event. |
| 432 | Users can always delete their own scheduled events; with the \fBadmin\fR |
| 433 | right you can delete any event. |
| 434 | .TP |
| 435 | .B schedule-get \fIEVENT\fR |
| 436 | Sends the details of scheduled event \fIEVENT\fR in a response body. |
| 437 | Each line is a pair of strings quoted in the usual way, the first being the key |
| 438 | ane the second the value. |
| 439 | No particular order is used. |
| 440 | .IP |
| 441 | Scheduled events are considered public information. |
| 442 | Right \fBread\fR is sufficient to see details of all events. |
| 443 | .TP |
| 444 | .B schedule-list |
| 445 | Sends the event IDs of all scheduled events in a response body, in no |
| 446 | particular order. |
| 447 | Use \fBschedule-get\fR to get the details of each event. |
| 448 | .TP |
| 449 | .B search \fITERMS\fR |
| 450 | Search for tracks matching the search terms. |
| 451 | The results are put in a response body, one to a line. |
| 452 | .IP |
| 453 | The search string is split in the usual way, with quoting supported, into a |
| 454 | list of terms. |
| 455 | Only tracks matching all terms are included in the results. |
| 456 | .IP |
| 457 | Any terms of the form \fBtag:\fITAG\fR limits the search to tracks with that |
| 458 | tag. |
| 459 | .IP |
| 460 | All other terms are interpreted as individual words which must be present in |
| 461 | the track name. |
| 462 | .IP |
| 463 | Spaces in terms don't currently make sense, but may one day be interpreted to |
| 464 | allow searching for phrases. |
| 465 | .TP |
| 466 | .B \fBset\fR \fITRACK\fR \fIPREF\fR \fIVALUE\fR |
| 467 | Set a preference. |
| 468 | Requires the \fBprefs\fR right. |
| 469 | .TP |
| 470 | .B set\-global \fIKEY\fR \fIVALUE\fR |
| 471 | Set a global preference. |
| 472 | Requires the \fBglobal prefs\fR right. |
| 473 | .TP |
| 474 | .B shutdown |
| 475 | Requests server shutdown. |
| 476 | Requires the \fBadmin\fR right. |
| 477 | .TP |
| 478 | .B stats |
| 479 | Send server statistics in plain text in a response body. |
| 480 | .TP |
| 481 | .B \fBtags\fR |
| 482 | Send the list of currently known tags in a response body. |
| 483 | .TP |
| 484 | .B \fBunset\fR \fITRACK\fR \fIPREF\fR |
| 485 | Unset a preference. |
| 486 | Requires the \fBprefs\fR right. |
| 487 | .TP |
| 488 | .B \fBunset\-global\fR \fIKEY\fR |
| 489 | Unset a global preference. |
| 490 | Requires the \fBglobal prefs\fR right. |
| 491 | .TP |
| 492 | .B user \fIUSERNAME\fR \fIRESPONSE\fR |
| 493 | Authenticate as user \fIUSERNAME\fR. |
| 494 | See |
| 495 | .B AUTHENTICATION |
| 496 | below. |
| 497 | .TP |
| 498 | .B userinfo \fIUSERNAME PROPERTY |
| 499 | Get a user property. |
| 500 | See \fBUSER PROPERTIES\fR below. |
| 501 | .TP |
| 502 | .B users |
| 503 | Send the list of currently known users in a response body. |
| 504 | .TP |
| 505 | .B version |
| 506 | Send back a response with the server version as the second field. |
| 507 | .TP |
| 508 | .B volume \fR[\fILEFT\fR [\fIRIGHT\fR]] |
| 509 | Get or set the volume. |
| 510 | .IP |
| 511 | With zero parameters just gets the volume and reports the left and right sides |
| 512 | as the 2nd and 3rd fields of the response. |
| 513 | .IP |
| 514 | With one parameter sets both sides to the same value. |
| 515 | With two parameters sets each side independently. |
| 516 | Setting the volume requires the \fBvolume\fR right. |
| 517 | .SH RESPONSES |
| 518 | Response lines start with a three-digit status code followed by a space. |
| 519 | The meaning the response and the interpretation of the rest of the line depends |
| 520 | on that code. |
| 521 | .PP |
| 522 | The first digit distinguishes errors from successful responses: |
| 523 | .TP |
| 524 | .B 2 |
| 525 | Operation succeeded. |
| 526 | .TP |
| 527 | .B 5 |
| 528 | Operation failed. |
| 529 | .PP |
| 530 | The second digit breaks down the origin of the response: |
| 531 | .TP |
| 532 | .B 0 |
| 533 | Generic responses not specific to the handling of the command. |
| 534 | .TP |
| 535 | .B 1 |
| 536 | 51x errors indicate that the user had insufficient rights for the command. |
| 537 | .TP |
| 538 | .B 3 |
| 539 | Authentication responses. |
| 540 | .TP |
| 541 | .B 5 |
| 542 | Responses specific to the handling of the command. |
| 543 | .PP |
| 544 | The third digit provides extra information about the response: |
| 545 | .TP |
| 546 | .B 0 |
| 547 | Text part is just commentary, intended to be human-readable. |
| 548 | .TP |
| 549 | .B 1 |
| 550 | Text part is a constant result (e.g. \fBversion\fR). |
| 551 | It will not change on a subsequent use of the same command on the same |
| 552 | conneciton. |
| 553 | .TP |
| 554 | .B 2 |
| 555 | Text part is a potentially variable result. |
| 556 | .TP |
| 557 | .B 3 |
| 558 | Text part is just commentary; a dot-stuffed body follows. |
| 559 | .TP |
| 560 | .B 4 |
| 561 | Text part is just commentary; an indefinite dot-stuffed body follows. |
| 562 | (Used for \fBlog\fR.) |
| 563 | .TP |
| 564 | .B 5 |
| 565 | Used with "harmless" errors, for instance a preference not being found. |
| 566 | The text part is commentary. |
| 567 | .TP |
| 568 | .B 9 |
| 569 | The text part is just commentary (but would normally be a response for this |
| 570 | command) e.g. \fBplaying\fR. |
| 571 | .PP |
| 572 | Result strings (not bodies) intended for machine parsing (i.e. xx1 and xx2 |
| 573 | responses) are structure into fields in the the same way as command lines. |
| 574 | .SH AUTHENTICATION |
| 575 | When a connection is made the server sends a \fB231\fR response before any |
| 576 | command is received. |
| 577 | This contains a protocol generation, an algorithm name and a |
| 578 | challenge encoded in hex, in the fields of the response line. |
| 579 | .PP |
| 580 | The current protocol generation is \fB2\fR. |
| 581 | .PP |
| 582 | The possible algorithms are (currently) \fBsha1\fR, \fBsha256\fR, \fBsha384\fR |
| 583 | and \fBsha512\fR. |
| 584 | Completely upper-case names such as \fBSHA1\fR etc work as synonyms. |
| 585 | .PP |
| 586 | The \fBuser\fR response consists of the selected hash of the user's password |
| 587 | concatenated with the challenge, encoded in hex. |
| 588 | .SH "TRACK INFORMATION" |
| 589 | Track information is encoded in a response line as pairs of fields. |
| 590 | The first is a name, the second a value. |
| 591 | The names have the following meanings: |
| 592 | .TP 12 |
| 593 | .B expected |
| 594 | The time the track is expected to be played at. |
| 595 | .TP |
| 596 | .B id |
| 597 | A string uniquely identifying this queue entry. |
| 598 | .TP |
| 599 | .B played |
| 600 | The time the track was played at. |
| 601 | .TP |
| 602 | .B scratched |
| 603 | The user that scratched the track. |
| 604 | .TP |
| 605 | .B origin |
| 606 | The origin of the track. Valid origins are: |
| 607 | .RS |
| 608 | .TP 12 |
| 609 | .B adopted |
| 610 | The track was originally randomly picked but has been adopted by a user. |
| 611 | .TP |
| 612 | .B picked |
| 613 | The track was picked by a user. |
| 614 | .TP |
| 615 | .B random |
| 616 | The track was randomly picked. |
| 617 | .TP |
| 618 | .B scheduled |
| 619 | The track was played from a scheduled action. |
| 620 | .TP |
| 621 | .B scratch |
| 622 | The track is a scratch sound. |
| 623 | .RE |
| 624 | .TP |
| 625 | .B state |
| 626 | The current track state. |
| 627 | Valid states are: |
| 628 | .RS |
| 629 | .TP 12 |
| 630 | .B failed |
| 631 | The player failed (exited with nonzero status but wasn't scratched). |
| 632 | .TP |
| 633 | .B ok |
| 634 | The track was played without any problems. |
| 635 | .TP |
| 636 | .B scratched |
| 637 | The track was scratched. |
| 638 | .TP |
| 639 | .B started |
| 640 | The track is currently playing. |
| 641 | .TP |
| 642 | .B paused |
| 643 | Track is playing but paused. |
| 644 | .TP |
| 645 | .B unplayed |
| 646 | In the queue, hasn't been played yet. |
| 647 | .TP |
| 648 | .B quitting |
| 649 | The track was terminated because the server is shutting down. |
| 650 | .RE |
| 651 | .TP |
| 652 | .B submitter |
| 653 | The user that submitted the track. |
| 654 | .TP |
| 655 | .B track |
| 656 | The filename of the track. |
| 657 | .TP |
| 658 | .B when |
| 659 | The time the track was added to the queue. |
| 660 | .TP |
| 661 | .B wstat |
| 662 | The wait status of the player in decimal. |
| 663 | .PP |
| 664 | Note that \fBorigin\fR is new with DisOrder 4.3, and obsoletes some old |
| 665 | \fBstate\fR values. |
| 666 | .SH "EVENT LOG" |
| 667 | The event log consists of lines starting with a hexadecimal timestamp and a |
| 668 | keyword followed by (optionally) parameters, which are structured into fields |
| 669 | in the same way as command and response lines. |
| 670 | Currently the following keywords are used: |
| 671 | .TP |
| 672 | .B adopted \fIID\fR \fIUSERNAME\fR |
| 673 | \fIUSERNAME\fR adopted track \fIID\fR. |
| 674 | .TP |
| 675 | .B completed \fITRACK\fR |
| 676 | Completed playing \fITRACK\fR |
| 677 | .TP |
| 678 | .B failed \fITRACK\fR \fIERROR\fR |
| 679 | Completed playing \fITRACK\fR with an error status |
| 680 | .TP |
| 681 | .B global_pref \fIPREF\fR [\fIVALUE\fR] |
| 682 | A global preference was set or unset. |
| 683 | .TP |
| 684 | .B moved \fIUSERNAME\fR |
| 685 | User \fIUSERNAME\fR moved some track(s). |
| 686 | Further details aren't included any more. |
| 687 | .TP |
| 688 | .B playing \fITRACK\fR [\fIUSERNAME\fR] |
| 689 | Started playing \fITRACK\fR. |
| 690 | .TP |
| 691 | .B playlist_created \fIPLAYLIST\fR \fISHARING\fR |
| 692 | Sent when a playlist is created. |
| 693 | For private playlists this is intended to be sent only to the owner (but |
| 694 | this is not currently implemented). |
| 695 | .TP |
| 696 | .B playlist_deleted \fIPLAYLIST\fR |
| 697 | Sent when a playlist is deleted. |
| 698 | For private playlists this is intended to be sent only to the owner (but |
| 699 | this is not currently implemented). |
| 700 | .TP |
| 701 | .B playlist_modified \fIPLAYLIST\fR \fISHARING\fR |
| 702 | Sent when a playlist is modified (either its contents or its sharing status). |
| 703 | For private playlists this is intended to be sent only to the owner (but |
| 704 | this is not currently implemented). |
| 705 | .TP |
| 706 | .B queue \fIQUEUE-ENTRY\fR... |
| 707 | Added \fITRACK\fR to the queue. |
| 708 | .TP |
| 709 | .B recent_added \fIQUEUE-ENTRY\fR... |
| 710 | Added \fIID\fR to the recently played list. |
| 711 | .TP |
| 712 | .B recent_removed \fIID\fR |
| 713 | Removed \fIID\fR from the recently played list. |
| 714 | .TP |
| 715 | .B removed \fIID\fR [\fIUSERNAME\fR] |
| 716 | Queue entry \fIID\fR was removed. |
| 717 | This is used both for explicit removal (when \fIUSERNAME\fR is present) |
| 718 | and when playing a track (when it is absent). |
| 719 | .TP |
| 720 | .B rescanned |
| 721 | A rescan completed. |
| 722 | .TP |
| 723 | .B scratched \fITRACK\fR \fIUSERNAME\fR |
| 724 | \fITRACK\fR was scratched by \fIUSERNAME\fR. |
| 725 | .TP |
| 726 | .B state \fIKEYWORD\fR |
| 727 | Some state change occurred. |
| 728 | The current set of keywords is: |
| 729 | .RS |
| 730 | .TP |
| 731 | .B completed |
| 732 | The current track completed successfully. |
| 733 | .TP |
| 734 | .B disable_play |
| 735 | Playing was disabled. |
| 736 | .TP |
| 737 | .B disable_random |
| 738 | Random play was disabled. |
| 739 | .TP |
| 740 | .B enable_play |
| 741 | Playing was enabled. |
| 742 | .TP |
| 743 | .B enable_random |
| 744 | Random play was enabled. |
| 745 | .TP |
| 746 | .B failed |
| 747 | The current track failed. |
| 748 | .TP |
| 749 | .B pause |
| 750 | The current track was paused. |
| 751 | .TP |
| 752 | .B playing |
| 753 | A track started playing. |
| 754 | .TP |
| 755 | .B resume |
| 756 | The current track was resumed. |
| 757 | .TP |
| 758 | .B rights_changed \fIRIGHTS\fR |
| 759 | User's rights were changed. |
| 760 | .TP |
| 761 | .B scratched |
| 762 | The current track was scratched. |
| 763 | .PP |
| 764 | To simplify client implementation, \fBstate\fR commands reflecting the current |
| 765 | state are sent at the start of the log. |
| 766 | .RE |
| 767 | .TP |
| 768 | .B user_add \fIUSERNAME\fR |
| 769 | A user was created. |
| 770 | .TP |
| 771 | .B user_delete \fIUSERNAME\fR |
| 772 | A user was deleted. |
| 773 | .TP |
| 774 | .B user_edit \fIUSERNAME\fR \fIPROPERTY\fR |
| 775 | Some property of a user was edited. |
| 776 | .TP |
| 777 | .B user_confirm \fIUSERNAME\fR |
| 778 | A user's login was confirmed (via the web interface). |
| 779 | .TP |
| 780 | .B volume \fILEFT\fR \fIRIGHT\fR |
| 781 | The volume changed. |
| 782 | .PP |
| 783 | .IR QUEUE-ENTRY ... |
| 784 | is as defined in |
| 785 | .B "TRACK INFORMATION" |
| 786 | above. |
| 787 | .PP |
| 788 | The \fBuser-*\fR messages are only sent to admin users, and are not sent over |
| 789 | non-local connections unless \fBremote_userman\fR is enabled. |
| 790 | .SH "USER PROPERTIES" |
| 791 | The following user properties are defined: |
| 792 | .TP |
| 793 | .B created |
| 794 | The timestamp when the user was created. |
| 795 | See \fBTIMESTAMPS\fR below. |
| 796 | This user property cannot be modified. |
| 797 | .TP |
| 798 | .B email |
| 799 | The user's email address. |
| 800 | .TP |
| 801 | .B password |
| 802 | The user's password. |
| 803 | .TP |
| 804 | .B rights |
| 805 | The rights the user has, separated by commas. |
| 806 | .SH RIGHTS |
| 807 | The full set of rights are: |
| 808 | .TP |
| 809 | .B read |
| 810 | User can perform read-only operations |
| 811 | .TP |
| 812 | .B play |
| 813 | User can add tracks to the queue |
| 814 | .TP |
| 815 | .B "move any" |
| 816 | User can move any track |
| 817 | .TP |
| 818 | .B "move mine" |
| 819 | User can move their own tracks |
| 820 | .TP |
| 821 | .B "move random" |
| 822 | User can move randomly chosen tracks |
| 823 | .TP |
| 824 | .B "remove any" |
| 825 | User can remove any track |
| 826 | .TP |
| 827 | .B "remove mine" |
| 828 | User can remove their own tracks |
| 829 | .TP |
| 830 | .B "remove random" |
| 831 | User can remove randomly chosen tracks |
| 832 | .TP |
| 833 | .B "scratch any" |
| 834 | User can scratch any track |
| 835 | .TP |
| 836 | .B "scratch mine" |
| 837 | User can scratch their own tracks |
| 838 | .TP |
| 839 | .B "scratch random" |
| 840 | User can scratch randomly chosen tracks |
| 841 | .TP |
| 842 | .B volume |
| 843 | User can change the volume |
| 844 | .TP |
| 845 | .B admin |
| 846 | User can perform admin operations |
| 847 | .TP |
| 848 | .B rescan |
| 849 | User can initiate a rescan |
| 850 | .TP |
| 851 | .B register |
| 852 | User can register new users. |
| 853 | Normally only the |
| 854 | .B guest |
| 855 | user would have this right. |
| 856 | .TP |
| 857 | .B userinfo |
| 858 | User can edit their own userinfo |
| 859 | .TP |
| 860 | .B prefs |
| 861 | User can modify track preferences |
| 862 | .TP |
| 863 | .B "global prefs" |
| 864 | User can modify global preferences |
| 865 | .TP |
| 866 | .B pause |
| 867 | User can pause/resume |
| 868 | .SH TIMESTAMPS |
| 869 | A \fItimestamp\fR is a decimal integer giving a number of seconds past the |
| 870 | epoch, disregarding counting leap seconds. |
| 871 | The epoch is midnight, January 1 1970, UTC. |
| 872 | .SH NOTES |
| 873 | For file listings, the regexp applies to the basename of the returned file, not |
| 874 | the whole filename, and letter case is ignored. |
| 875 | \fBpcrepattern\fR(3) describes the regexp syntax. |
| 876 | .PP |
| 877 | Filenames are in UTF-8 even if the collection they come from uses some other |
| 878 | encoding - if you want to access the real file (in such cases as the filenames |
| 879 | actually correspond to a real file) you'll have to convert to whatever the |
| 880 | right encoding is. |
| 881 | .SH "SEE ALSO" |
| 882 | \fBdisorder\fR(1), |
| 883 | \fBtime\fR(2), |
| 884 | \fBdisorder\fR(3), |
| 885 | \fBpcrepattern\fR(3) |
| 886 | \fBdisorder_config\fR(5), |
| 887 | \fBdisorderd\fR(8), |
| 888 | \fButf8\fR(7) |
| 889 | .\" Local Variables: |
| 890 | .\" mode:nroff |
| 891 | .\" fill-column:79 |
| 892 | .\" End: |