Commit | Line | Data |
---|---|---|
460b9539 | 1 | .\" |
964e027d | 2 | .\" Copyright (C) 2004-2008 Richard Kettlewell |
460b9539 | 3 | .\" |
e7eb3a27 | 4 | .\" This program is free software: you can redistribute it and/or modify |
460b9539 | 5 | .\" it under the terms of the GNU General Public License as published by |
e7eb3a27 | 6 | .\" the Free Software Foundation, either version 3 of the License, or |
460b9539 | 7 | .\" (at your option) any later version. |
e7eb3a27 RK |
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 | .\" | |
460b9539 | 14 | .\" You should have received a copy of the GNU General Public License |
e7eb3a27 | 15 | .\" along with this program. If not, see <http://www.gnu.org/licenses/>. |
460b9539 | 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 | |
c0c23a60 RK |
24 | The protocol is liable to change without notice. |
25 | You are recommended to check the implementation before believing this document. | |
460b9539 | 26 | .SH "GENERAL SYNTAX" |
c0c23a60 RK |
27 | Everything is encoded using UTF-8. |
28 | See | |
f9635e06 RK |
29 | .B "CHARACTER ENCODING" |
30 | below for more detail on character encoding issues. | |
460b9539 | 31 | .PP |
f9635e06 RK |
32 | Commands and responses consist of a line perhaps followed (depending on the |
33 | command or response) by a body. | |
460b9539 | 34 | .PP |
35 | The line syntax is the same as described in \fBdisorder_config\fR(5) except | |
36 | that comments are prohibited. | |
37 | .PP | |
38 | Bodies borrow their syntax from RFC821; they consist of zero or more ordinary | |
39 | lines, with any initial full stop doubled up, and are terminated by a line | |
40 | consisting of a full stop and a line feed. | |
41 | .SH COMMANDS | |
42 | Commands always have a command name as the first field of the line; responses | |
c0c23a60 RK |
43 | always have a 3-digit response code as the first field. |
44 | See below for more details about this field. | |
460b9539 | 45 | .PP |
46 | All commands require the connection to have been already authenticated unless | |
c0c23a60 RK |
47 | stated otherwise. |
48 | If not stated otherwise, the \fBread\fR right is sufficient to execute | |
49 | the command. | |
460b9539 | 50 | .PP |
51 | Neither commands nor responses have a body unless stated otherwise. | |
52 | .TP | |
0f55e905 | 53 | .B adduser \fIUSERNAME PASSWORD \fR[\fIRIGHTS\fR] |
c0c23a60 RK |
54 | Create a new user with the given username and password. |
55 | The new user's rights list can be specified; if it is not | |
56 | then the \fBdefault_rights\fR setting applies instead. | |
57 | Requires the \fBadmin\fR right, and only works on local | |
0f55e905 | 58 | connections. |
eb5dc014 | 59 | .TP |
d42e98ca RK |
60 | .B adopt \fIID\fR |
61 | Adopts a randomly picked track, leaving it in a similar state to if it was | |
62 | picked by this user. Requires the \fBplay\fR right. | |
63 | .TP | |
460b9539 | 64 | .B allfiles \fIDIRECTORY\fR [\fIREGEXP\fR] |
5818980a | 65 | List all the files and directories in \fIDIRECTORY\fR in a response body. |
460b9539 | 66 | If \fIREGEXP\fR is present only matching files and directories are returned. |
67 | .TP | |
ba39faf6 | 68 | .B confirm \fICONFIRMATION |
c0c23a60 RK |
69 | Confirm user registration. |
70 | \fICONFIRMATION\fR is as returned from \fBregister\fR below. | |
71 | This command can be used without logging in. | |
ba39faf6 | 72 | .TP |
eb5dc014 | 73 | .B cookie \fICOOKIE |
0d350ff0 | 74 | Log a user back in using a cookie created with \fBmake\-cookie\fR. |
c0c23a60 | 75 | The response contains the username. |
eb5dc014 RK |
76 | .TP |
77 | .B deluser \fIUSERNAME | |
c0c23a60 RK |
78 | Delete the named user. |
79 | Requires the \fBadmin\fR right, and only works on local connections. | |
460b9539 | 80 | .TP |
81 | .B dirs \fIDIRECTORY\fR [\fIREGEXP\fR] | |
5818980a | 82 | List all the directories in \fIDIRECTORY\fR in a response body. |
460b9539 | 83 | If \fIREGEXP\fR is present only matching directories are returned. |
84 | .TP | |
85 | .B disable \fR[\fBnow\fR] | |
c0c23a60 RK |
86 | Disable further playing. |
87 | If the optional \fBnow\fR argument is present then the current track | |
88 | is stopped. | |
89 | Requires the \fBglobal prefs\fR right. | |
eb5dc014 RK |
90 | .TP |
91 | .B edituser \fIUSERNAME PROPERTY VALUE | |
c0c23a60 RK |
92 | Set a user property. |
93 | With the \fBadmin\fR right any username and property may be specified. | |
94 | Otherwise the \fBuserinfo\fR right is required and only the | |
eb5dc014 | 95 | \fBemail\fR and \fBpassword\fR properties may be set. |
0517868c RK |
96 | .IP |
97 | User properties are syntax-checked before setting. For instance \fBemail\fR | |
98 | must contain an "@" sign or you will get an error. (Setting an empty value for | |
99 | \fBemail\fR is allowed and removes the property.) | |
460b9539 | 100 | .TP |
101 | .B enable | |
c0c23a60 RK |
102 | Re-enable further playing, and is the opposite of \fBdisable\fR. |
103 | Requires the \fBglobal prefs\fR right. | |
460b9539 | 104 | .TP |
105 | .B enabled | |
c0c23a60 RK |
106 | Report whether playing is enabled. |
107 | The second field of the response line will be \fByes\fR or \fBno\fR. | |
460b9539 | 108 | .TP |
109 | .B exists \fITRACK\fR | |
c0c23a60 RK |
110 | Report whether the named track exists. |
111 | The second field of the response line will be \fByes\fR or \fBno\fR. | |
460b9539 | 112 | .TP |
113 | .B files \fIDIRECTORY\fR [\fIREGEXP\fR] | |
5818980a | 114 | List all the files in \fIDIRECTORY\fR in a response body. |
460b9539 | 115 | If \fIREGEXP\fR is present only matching files are returned. |
116 | .TP | |
117 | .B get \fITRACK\fR \fIPREF\fR | |
c0c23a60 RK |
118 | Getsa preference value. |
119 | On success the second field of the response line will have the value. | |
fb1bc1f5 RK |
120 | .IP |
121 | If the track or preference do not exist then the response code is 555. | |
460b9539 | 122 | .TP |
0d350ff0 | 123 | .B get\-global \fIKEY\fR |
460b9539 | 124 | Get a global preference. |
fb1bc1f5 RK |
125 | .IP |
126 | If the preference does not exist then the response code is 555. | |
460b9539 | 127 | .TP |
128 | .B length \fITRACK\fR | |
c0c23a60 RK |
129 | Get the length of the track in seconds. |
130 | On success the second field of the response line will have the value. | |
460b9539 | 131 | .TP |
132 | .B log | |
c0c23a60 RK |
133 | Send event log messages in a response body. |
134 | The command will never terminate. | |
135 | Any further data sent to the server will be discarded (explicitly; | |
136 | i.e. it will not accumulate in a buffer somewhere). | |
460b9539 | 137 | .IP |
138 | See \fBEVENT LOG\fR below for more details. | |
139 | .TP | |
0d350ff0 | 140 | .B make\-cookie |
eb5dc014 RK |
141 | Returns an opaque string that can be used by the \fBcookie\fR command to log |
142 | this user back in on another connection (until the cookie expires). | |
143 | .TP | |
460b9539 | 144 | .B move \fITRACK\fR \fIDELTA\fR |
c0c23a60 RK |
145 | Move a track in the queue. |
146 | The track may be identified by ID (preferred) or name (which might cause | |
147 | confusion if it's there twice). | |
148 | \fIDELTA\fR should be an negative or positive integer and indicates how | |
149 | many steps towards the head of the queue the track should be moved. | |
eb5dc014 RK |
150 | .IP |
151 | Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights | |
152 | depending on how the track came to be added to the queue. | |
460b9539 | 153 | .TP |
154 | .B moveafter \fITARGET\fR \fIID\fR ... | |
c0c23a60 RK |
155 | Move all the tracks in the \fIID\fR list after ID \fITARGET\fR. |
156 | If \fITARGET\fR is the empty string then the listed tracks are put | |
157 | at the head of the queue. | |
158 | If \fITARGET\fR is listed in the ID list then the tracks are moved | |
460b9539 | 159 | to just after the first non-listed track before it, or to the head if there is |
160 | no such track. | |
eb5dc014 RK |
161 | .IP |
162 | Requires one of the \fBmove mine\fR, \fBmove random\fR or \fBmove any\fR rights | |
163 | depending on how the tracks came to be added to the queue. | |
460b9539 | 164 | .TP |
2a10b70b | 165 | .B new \fR[\fIMAX\fR] |
c0c23a60 RK |
166 | Send the most recently added \fIMAX\fR tracks in a response body. |
167 | If the argument is ommitted, the \fBnew_max\fR most recent tracks are | |
168 | listed (see \fBdisorder_config\fR(5)). | |
2a10b70b | 169 | .TP |
7858930d | 170 | .B nop |
c0c23a60 RK |
171 | Do nothing. |
172 | Used by | |
7858930d | 173 | .BR disobedience (1) |
c0c23a60 RK |
174 | as a keepalive measure. |
175 | This command does not require authentication. | |
7858930d | 176 | .TP |
460b9539 | 177 | .B part \fITRACK\fR \fICONTEXT\fI \fIPART\fR |
c0c23a60 RK |
178 | Get a track name part. |
179 | Returns an empty string if a name part cannot be constructed. | |
460b9539 | 180 | .IP |
181 | .I CONTEXT | |
182 | is one of | |
183 | .B sort | |
184 | or | |
185 | .B display | |
186 | and | |
187 | .I PART | |
188 | is usually one of | |
189 | .BR artist , | |
190 | .B album | |
191 | or | |
192 | .BR title . | |
193 | .TP | |
194 | .B pause | |
c0c23a60 RK |
195 | Pause the current track. |
196 | Requires the \fBpause\fR right. | |
460b9539 | 197 | .TP |
198 | .B play \fITRACK\fR | |
c0c23a60 RK |
199 | Add a track to the queue. |
200 | The response contains the queue ID of the track. | |
eb5dc014 | 201 | Requires the \fBplay\fR right. |
460b9539 | 202 | .TP |
203 | .B playing | |
5818980a | 204 | Report what track is playing. |
460b9539 | 205 | .IP |
206 | If the response is \fB252\fR then the rest of the response line consists of | |
207 | track information (see below). | |
208 | .IP | |
209 | If the response is \fB259\fR then nothing is playing. | |
210 | .TP | |
211 | .B prefs \fBTRACK\fR | |
5818980a | 212 | Send back the preferences for \fITRACK\fR in a response body. |
460b9539 | 213 | Each line of the response has the usual line syntax, the first field being the |
214 | name of the pref and the second the value. | |
215 | .TP | |
216 | .B queue | |
5818980a | 217 | Send back the current queue in a response body, one track to a line, the track |
c0c23a60 RK |
218 | at the head of the queue (i.e. next to be be played) first. |
219 | See below for the track information syntax. | |
460b9539 | 220 | .TP |
0d350ff0 | 221 | .B random\-disable |
c0c23a60 RK |
222 | Disable random play (but don't stop the current track). |
223 | Requires the \fBglobal prefs\fR right. | |
460b9539 | 224 | .TP |
0d350ff0 | 225 | .B random\-enable |
c0c23a60 RK |
226 | Enable random play. |
227 | Requires the \fBglobal prefs\fR right. | |
460b9539 | 228 | .TP |
0d350ff0 | 229 | .B random\-enabled |
c0c23a60 RK |
230 | Report whether random play is enabled. |
231 | The second field of the response line will be \fByes\fR or \fBno\fR. | |
460b9539 | 232 | .TP |
233 | .B recent | |
5818980a | 234 | Send back the current recently-played list in a response body, one track to a |
c0c23a60 RK |
235 | line, the track most recently played last. |
236 | See below for the track information syntax. | |
460b9539 | 237 | .TP |
238 | .B reconfigure | |
c0c23a60 RK |
239 | Request that DisOrder reconfigure itself. |
240 | Requires the \fBadmin\fR right. | |
460b9539 | 241 | .TP |
90ad6c6e | 242 | .B register \fIUSERNAME PASSWORD EMAIL |
c0c23a60 RK |
243 | Register a new user. |
244 | Requires the \fBregister\fR right. | |
245 | The result contains a confirmation string; the user will be be able | |
246 | to log in until this has been presented back to the server via the | |
247 | \fBconfirm\fR command. | |
ba39faf6 | 248 | .TP |
90ad6c6e RK |
249 | .B reminder \fIUSERNAME\fR |
250 | Send a password reminder to user \fIUSERNAME\fR. | |
c0c23a60 RK |
251 | If the user has no valid email address, or no password, or a |
252 | reminder has been sent too recently, then no reminder will be sent. | |
6207d2f3 | 253 | .TP |
460b9539 | 254 | .B remove \fIID\fR |
c0c23a60 RK |
255 | Remove the track identified by \fIID\fR. |
256 | Requires one of the \fBremove mine\fR, \fBremove random\fR or | |
257 | \fBremove any\fR rights depending on how the | |
eb5dc014 | 258 | track came to be added to the queue. |
460b9539 | 259 | .TP |
dd9af5cb | 260 | .B rescan \fR[\fBwait\fR] \fR[\fBfresh\fR] |
c0c23a60 RK |
261 | Rescan all roots for new or obsolete tracks. |
262 | Requires the \fBrescan\fR right. | |
dd9af5cb RK |
263 | .IP |
264 | If the \fBwait\fR flag is present then the response is delayed until the rescan | |
265 | completes. | |
266 | Otherwise the response arrives immediately. | |
267 | This is primarily intended for testing. | |
268 | .IP | |
269 | If the \fBfresh\fR flag is present a rescan is already underway then a second | |
270 | rescan will be started when it completes. | |
271 | The default behavior is to piggyback on the existing rescan. | |
272 | .IP | |
273 | NB that \fBfresh\fR is currently disabled in the server source, so using this | |
274 | flag will just provoke an error. | |
460b9539 | 275 | .TP |
276 | .B resolve \fITRACK\fR | |
277 | Resolve a track name, i.e. if this is an alias then return the real track name. | |
278 | .TP | |
279 | .B resume | |
c0c23a60 RK |
280 | Resume the current track after a \fBpause\fR command. |
281 | Requires the \fBpause\fR right. | |
eb5dc014 RK |
282 | .TP |
283 | .B revoke \fBcookie\fR | |
0d350ff0 | 284 | Revoke a cookie previously created with \fBmake\-cookie\fR. |
c0c23a60 | 285 | It will not be possible to use this cookie in the future. |
460b9539 | 286 | .TP |
0d350ff0 | 287 | .B rtp\-address |
5818980a | 288 | Report the RTP broadcast (or multicast) address, in the form \fIADDRESS |
c0c23a60 RK |
289 | PORT\fR. |
290 | This command does not require authentication. | |
ca831831 | 291 | .TP |
460b9539 | 292 | .B scratch \fR[\fIID\fR] |
293 | Remove the track identified by \fIID\fR, or the currently playing track if no | |
c0c23a60 RK |
294 | \fIID\fR is specified. |
295 | Requires one of the \fBscratch mine\fR, \fBscratch random\fR or | |
296 | \fBscratch any\fR rights depending on how the track came to be | |
eb5dc014 | 297 | added to the queue. |
460b9539 | 298 | .TP |
2b33c4cf RK |
299 | .B schedule-add \fIWHEN\fR \fIPRIORITY\fR \fIACTION\fR ... |
300 | Schedule an event for the future. | |
301 | .IP | |
302 | .I WHEN | |
303 | is the time when it should happen, as \fBtime_t\fR value. | |
304 | It must refer to a time in the future. | |
305 | .IP | |
306 | .I PRIORITY | |
307 | is the event priority. | |
308 | This can be \fBnormal\fR, in which case the event will be run at startup if its | |
309 | time has past, or \fBjunk\fR in which case it will be discarded if it is found | |
310 | to be in the past at startup. | |
311 | The meaning of other values is not defined. | |
312 | .IP | |
313 | .I ACTION | |
314 | is the action to perform. | |
315 | The choice of action determines the meaning of the remaining arguments. | |
316 | Possible actions are: | |
317 | .RS | |
318 | .TP | |
319 | .B play | |
320 | Play a track. | |
321 | The next argument is the track name. | |
322 | Requires the \fBplay\fR right. | |
323 | .TP | |
324 | .B set-global | |
325 | Set a global preference. | |
326 | The next argument is the preference name and the final argument is the value to | |
327 | set it to (omit it to unset it). | |
328 | Requires the \fBglobal prefs\fR right. | |
329 | .RE | |
330 | .IP | |
331 | You need the right at the point you create the event. | |
332 | It is not possible to create scheduled events in expectation of a future change | |
333 | in rights. | |
334 | .TP | |
335 | .B schedule-del \fIEVENT\fR | |
336 | Deletes a scheduled event. | |
337 | Users can always delete their own scheduled events; with the \fBadmin\fR | |
338 | right you can delete any event. | |
339 | .TP | |
340 | .B schedule-get \fIEVENT\fR | |
341 | Sends the details of scheduled event \fIEVENT\fR in a response body. | |
342 | Each line is a pair of strings quoted in the usual way, the first being the key | |
343 | ane the second the value. | |
344 | No particular order is used. | |
345 | .IP | |
346 | Scheduled events are considered public information. | |
347 | Right \fBread\fR is sufficient to see details of all events. | |
348 | .TP | |
349 | .B schedule-list | |
350 | Sends the event IDs of all scheduled events in a response body, in no | |
351 | particular order. | |
352 | Use \fBschedule-get\fR to get the details of each event. | |
353 | .TP | |
460b9539 | 354 | .B search \fITERMS\fR |
c0c23a60 RK |
355 | Search for tracks matching the search terms. |
356 | The results are put in a response body, one to a line. | |
460b9539 | 357 | .IP |
358 | The search string is split in the usual way, with quoting supported, into a | |
c0c23a60 RK |
359 | list of terms. |
360 | Only tracks matching all terms are included in the results. | |
460b9539 | 361 | .IP |
362 | Any terms of the form \fBtag:\fITAG\fR limits the search to tracks with that | |
363 | tag. | |
364 | .IP | |
365 | All other terms are interpreted as individual words which must be present in | |
366 | the track name. | |
367 | .IP | |
368 | Spaces in terms don't currently make sense, but may one day be interpreted to | |
369 | allow searching for phrases. | |
370 | .TP | |
371 | .B \fBset\fR \fITRACK\fR \fIPREF\fR \fIVALUE\fR | |
c0c23a60 RK |
372 | Set a preference. |
373 | Requires the \fBprefs\fR right. | |
460b9539 | 374 | .TP |
0d350ff0 | 375 | .B set\-global \fIKEY\fR \fIVALUE\fR |
c0c23a60 RK |
376 | Set a global preference. |
377 | Requires the \fBglobal prefs\fR right. | |
460b9539 | 378 | .TP |
379 | .B stats | |
380 | Send server statistics in plain text in a response body. | |
381 | .TP | |
382 | .B \fBtags\fR | |
383 | Send the list of currently known tags in a response body. | |
384 | .TP | |
385 | .B \fBunset\fR \fITRACK\fR \fIPREF\fR | |
c0c23a60 RK |
386 | Unset a preference. |
387 | Requires the \fBprefs\fR right. | |
460b9539 | 388 | .TP |
0d350ff0 | 389 | .B \fBunset\-global\fR \fIKEY\fR |
c0c23a60 RK |
390 | Unset a global preference. |
391 | Requires the \fBglobal prefs\fR right. | |
460b9539 | 392 | .TP |
90ad6c6e RK |
393 | .B user \fIUSERNAME\fR \fIRESPONSE\fR |
394 | Authenticate as user \fIUSERNAME\fR. | |
c0c23a60 | 395 | See |
5e3f9e08 RK |
396 | .B AUTHENTICATION |
397 | below. | |
460b9539 | 398 | .TP |
90ad6c6e | 399 | .B userinfo \fIUSERNAME PROPERTY |
3e3566ad RK |
400 | Get a user property. |
401 | .TP | |
eb5dc014 | 402 | .B users |
5818980a | 403 | Send the list of currently known users in a response body. |
eb5dc014 | 404 | .TP |
460b9539 | 405 | .B version |
406 | Send back a response with the server version as the second field. | |
407 | .TP | |
408 | .B volume \fR[\fILEFT\fR [\fIRIGHT\fR]] | |
409 | Get or set the volume. | |
410 | .IP | |
411 | With zero parameters just gets the volume and reports the left and right sides | |
412 | as the 2nd and 3rd fields of the response. | |
413 | .IP | |
c0c23a60 RK |
414 | With one parameter sets both sides to the same value. |
415 | With two parameters sets each side independently. | |
416 | Setting the volume requires the \fBvolume\fR right. | |
460b9539 | 417 | .SH RESPONSES |
c0c23a60 RK |
418 | Responses are three-digit codes. |
419 | The first digit distinguishes errors from succesful responses: | |
460b9539 | 420 | .TP |
421 | .B 2 | |
422 | Operation succeeded. | |
423 | .TP | |
424 | .B 5 | |
425 | Operation failed. | |
426 | .PP | |
427 | The second digit breaks down the origin of the response: | |
428 | .TP | |
429 | .B 0 | |
c0c23a60 RK |
430 | Generic responses not specific to the handling of the command. |
431 | Mostly this is parse errors. | |
460b9539 | 432 | .TP |
b4a80f69 | 433 | .B 1 |
434 | 51x errors indicate that the user had insufficient rights for the command. | |
435 | .TP | |
460b9539 | 436 | .B 3 |
437 | Authentication responses. | |
438 | .TP | |
439 | .B 5 | |
440 | Responses specific to the handling of the command. | |
441 | .PP | |
442 | The third digit provides extra information about the response: | |
443 | .TP | |
444 | .B 0 | |
445 | Text part is just commentary. | |
446 | .TP | |
447 | .B 1 | |
448 | Text part is a constant result e.g. \fBversion\fR. | |
449 | .TP | |
450 | .B 2 | |
451 | Text part is a potentially variable result. | |
452 | .TP | |
453 | .B 3 | |
454 | Text part is just commentary; a dot-stuffed body follows. | |
455 | .TP | |
456 | .B 4 | |
c0c23a60 RK |
457 | Text part is just commentary; an indefinite dot-stuffed body follows. |
458 | (Used for \fBlog\fR.) | |
460b9539 | 459 | .TP |
fb1bc1f5 | 460 | .B 5 |
c0c23a60 RK |
461 | Used with "normal" errors, for instance a preference not being found. |
462 | The text part is commentary. | |
fb1bc1f5 | 463 | .TP |
460b9539 | 464 | .B 9 |
465 | The text part is just commentary (but would normally be a response for this | |
466 | command) e.g. \fBplaying\fR. | |
7b32e917 RK |
467 | .PP |
468 | Result strings (not bodies) intended for machine parsing (i.e. xx1 and xx2 | |
469 | responses) are quoted. | |
460b9539 | 470 | .SH AUTHENTICATION |
5e3f9e08 | 471 | When a connection is made the server sends a \fB231\fR response before any |
c0c23a60 RK |
472 | command is received. |
473 | This contains a protocol generation, an algorithm name and a | |
474 | challenge encoded in hex, all separated by whitespace. | |
7b32e917 RK |
475 | .PP |
476 | The current protocol generation is \fB2\fR. | |
5e3f9e08 | 477 | .PP |
b3141726 | 478 | The possible algorithms are (currently) \fBsha1\fR, \fBsha256\fR, \fBsha384\fR |
c0c23a60 RK |
479 | and \fBsha512\fR. |
480 | \fBSHA1\fR etc work as synonyms. | |
460b9539 | 481 | .PP |
5e3f9e08 RK |
482 | The \fBuser\fR response consists of the selected hash of the user's password |
483 | concatenated with the challenge, encoded in hex. | |
460b9539 | 484 | .SH "TRACK INFORMATION" |
485 | Track information is encoded in a line (i.e. using the usual line syntax) as | |
c0c23a60 RK |
486 | pairs of fields. |
487 | The first is a name, the second a value. | |
488 | The names have the following meanings: | |
460b9539 | 489 | .TP 12 |
490 | .B expected | |
491 | The time the track is expected to be played at. | |
492 | .TP | |
493 | .B id | |
494 | A string uniquely identifying this queue entry. | |
495 | .TP | |
496 | .B played | |
497 | The time the track was played at. | |
498 | .TP | |
499 | .B scratched | |
500 | The user that scratched the track. | |
501 | .TP | |
d42e98ca RK |
502 | .B origin |
503 | The origin of the track. Valid origins are: | |
504 | .RS | |
505 | .TP 12 | |
506 | .B adopted | |
507 | The track was originally randomly picked but has been adopted by a user. | |
508 | .TP | |
509 | .B picked | |
510 | The track was picked by a user. | |
511 | .TP | |
512 | .B random | |
513 | The track was randomly picked. | |
514 | .TP | |
515 | .B scheduled | |
516 | The track was played from a scheduled action. | |
517 | .TP | |
518 | .B scratch | |
519 | The track is a scratch sound. | |
520 | .RE | |
521 | .TP | |
460b9539 | 522 | .B state |
c0c23a60 RK |
523 | The current track state. |
524 | Valid states are: | |
460b9539 | 525 | .RS |
526 | .TP 12 | |
527 | .B failed | |
528 | The player failed (exited with nonzero status but wasn't scratched). | |
529 | .TP | |
460b9539 | 530 | .B ok |
531 | The track was played without any problems. | |
532 | .TP | |
533 | .B scratched | |
534 | The track was scratched. | |
535 | .TP | |
536 | .B started | |
537 | The track is currently playing. | |
538 | .TP | |
d42e98ca RK |
539 | .B paused |
540 | Track is playing but paused. | |
541 | .TP | |
460b9539 | 542 | .B unplayed |
543 | In the queue, hasn't been played yet. | |
544 | .TP | |
545 | .B quitting | |
546 | The track was terminated because the server is shutting down. | |
547 | .RE | |
548 | .TP | |
549 | .B submitter | |
550 | The user that submitted the track. | |
551 | .TP | |
552 | .B track | |
553 | The filename of the track. | |
554 | .TP | |
555 | .B when | |
556 | The time the track was added to the queue. | |
557 | .TP | |
558 | .B wstat | |
559 | The wait status of the player in decimal. | |
d42e98ca RK |
560 | .PP |
561 | Note that \fBorigin\fR is new with DisOrder 4.3, and obsoletes some old | |
562 | \fBstate\fR values. | |
460b9539 | 563 | .SH NOTES |
564 | Times are decimal integers using the server's \fBtime_t\fR. | |
565 | .PP | |
566 | For file listings, the regexp applies to the basename of the returned file, not | |
c0c23a60 RK |
567 | the whole filename, and letter case is ignored. |
568 | \fBpcrepattern\fR(3) describes the regexp syntax. | |
460b9539 | 569 | .PP |
570 | Filenames are in UTF-8 even if the collection they come from uses some other | |
571 | encoding - if you want to access the real file (in such cases as the filenames | |
572 | actually correspond to a real file) you'll have to convert to whatever the | |
573 | right encoding is. | |
574 | .SH "EVENT LOG" | |
575 | The event log consists of lines starting with a hexadecimal timestamp and a | |
c0c23a60 RK |
576 | keyword followed by (optionally) parameters. |
577 | The parameters are quoted in the usual DisOrder way. | |
578 | Currently the following keywords are used: | |
460b9539 | 579 | .TP |
d42e98ca RK |
580 | .B adopted \fIID\fR \fIUSERNAME\fR |
581 | \fIUSERNAME\fR adopted track \fIID\fR. | |
582 | .TP | |
460b9539 | 583 | .B completed \fITRACK\fR |
584 | Completed playing \fITRACK\fR | |
585 | .TP | |
586 | .B failed \fITRACK\fR \fIERROR\fR | |
587 | Completed playing \fITRACK\fR with an error status | |
588 | .TP | |
90ad6c6e RK |
589 | .B moved \fIUSERNAME\fR |
590 | User \fIUSERNAME\fR moved some track(s). | |
c0c23a60 | 591 | Further details aren't included any more. |
460b9539 | 592 | .TP |
90ad6c6e | 593 | .B playing \fITRACK\fR [\fIUSERNAME\fR] |
460b9539 | 594 | Started playing \fITRACK\fR. |
595 | .TP | |
596 | .B queue \fIQUEUE-ENTRY\fR... | |
597 | Added \fITRACK\fR to the queue. | |
598 | .TP | |
599 | .B recent_added \fIQUEUE-ENTRY\fR... | |
600 | Added \fIID\fR to the recently played list. | |
601 | .TP | |
602 | .B recent_removed \fIID\fR | |
603 | Removed \fIID\fR from the recently played list. | |
604 | .TP | |
90ad6c6e | 605 | .B removed \fIID\fR [\fIUSERNAME\fR] |
c0c23a60 | 606 | Queue entry \fIID\fR was removed. |
90ad6c6e | 607 | This is used both for explicit removal (when \fIUSERNAME\fR is present) |
c0c23a60 | 608 | and when playing a track (when it is absent). |
460b9539 | 609 | .TP |
e025abff RK |
610 | .B rescanned |
611 | A rescan completed. | |
612 | .TP | |
90ad6c6e RK |
613 | .B scratched \fITRACK\fR \fIUSERNAME\fR |
614 | \fITRACK\fR was scratched by \fIUSERNAME\fR. | |
460b9539 | 615 | .TP |
616 | .B state \fIKEYWORD\fR | |
c0c23a60 RK |
617 | Some state change occurred. |
618 | The current set of keywords is: | |
460b9539 | 619 | .RS |
620 | .TP | |
5abe307a RK |
621 | .B completed |
622 | The current track completed successfully. | |
623 | .TP | |
460b9539 | 624 | .B disable_play |
625 | Playing was disabled. | |
626 | .TP | |
627 | .B disable_random | |
628 | Random play was disabled. | |
629 | .TP | |
630 | .B enable_play | |
631 | Playing was enabled. | |
632 | .TP | |
633 | .B enable_random | |
634 | Random play was enabled. | |
635 | .TP | |
5abe307a RK |
636 | .B failed |
637 | The current track failed. | |
638 | .TP | |
460b9539 | 639 | .B pause |
640 | The current track was paused. | |
641 | .TP | |
5abe307a RK |
642 | .B playing |
643 | A track started playing. | |
644 | .TP | |
460b9539 | 645 | .B resume |
646 | The current track was resumed. | |
5abe307a | 647 | .TP |
75e7b7c3 | 648 | .B rights_changed \fIRIGHTS\fR |
ad492e00 RK |
649 | User's rights were changed. |
650 | .TP | |
5abe307a RK |
651 | .B scratched |
652 | The current track was scratched. | |
653 | .PP | |
654 | To simplify client implementation, \fBstate\fR commands reflecting the current | |
655 | state are sent at the start of the log. | |
460b9539 | 656 | .RE |
bb03d79d | 657 | .TP |
75e7b7c3 | 658 | .B user_add \fIUSERNAME\fR |
58d2aad2 RK |
659 | A user was created. |
660 | .TP | |
75e7b7c3 | 661 | .B user_delete \fIUSERNAME\fR |
58d2aad2 RK |
662 | A user was deleted. |
663 | .TP | |
75e7b7c3 | 664 | .B user_edit \fIUSERNAME\fR \fIPROPERTY\fR |
58d2aad2 RK |
665 | Some property of a user was edited. |
666 | .TP | |
75e7b7c3 | 667 | .B user_confirm \fIUSERNAME\fR |
58d2aad2 | 668 | A user's login was confirmed (via the web interface). |
460b9539 | 669 | .TP |
670 | .B volume \fILEFT\fR \fIRIGHT\fR | |
671 | The volume changed. | |
672 | .PP | |
673 | .IR QUEUE-ENTRY ... | |
674 | is as defined in | |
675 | .B "TRACK INFORMATION" | |
676 | above. | |
58d2aad2 RK |
677 | .PP |
678 | The \fBuser-*\fR messages are only sent to admin users, and are not sent over | |
679 | non-local connections unless \fBremote_userman\fR is enabled. | |
f9635e06 | 680 | .SH "CHARACTER ENCODING" |
c0c23a60 RK |
681 | All data sent by both server and client is encoded using UTF-8. |
682 | Moreover it must be valid UTF-8, i.e. non-minimal sequences are not | |
683 | permitted, nor are surrogates, nor are code points outside the | |
684 | Unicode code space. | |
f9635e06 RK |
685 | .PP |
686 | There are no particular normalization requirements on either side of the | |
c0c23a60 RK |
687 | protocol. |
688 | The server currently converts internally to NFC, the client must | |
f9635e06 RK |
689 | normalize the responses returned if it needs some normalized form for further |
690 | processing. | |
691 | .PP | |
692 | The various characters which divide up lines may not be followed by combining | |
c0c23a60 RK |
693 | characters. |
694 | For instance all of the following are prohibited: | |
f9635e06 RK |
695 | .TP |
696 | .B o | |
c0c23a60 RK |
697 | LINE FEED followed by a combining character. |
698 | For example the sequence LINE FEED, COMBINING GRAVE ACCENT is never permitted. | |
f9635e06 RK |
699 | .TP |
700 | .B o | |
701 | APOSTROPHE or QUOTATION MARK followed by a combining character when used to | |
c0c23a60 RK |
702 | delimit fields. |
703 | For instance a line starting APOSTROPHE, COMBINING CEDILLA is prohibited. | |
f9635e06 RK |
704 | .IP |
705 | Note that such sequences are not prohibited when the quote character cannot be | |
c0c23a60 RK |
706 | interpreted as a field delimiter. |
707 | For instance APOSTROPHE, REVERSE SOLIDUS, APOSTROPHE, COMBINING CEDILLA, | |
708 | APOSTROPHE would be permitted. | |
f9635e06 RK |
709 | .TP |
710 | .B o | |
711 | REVERSE SOLIDUS (BACKSLASH) followed by a combining character in a quoted | |
c0c23a60 RK |
712 | string when it is the first character of an escape sequence. |
713 | For instance a line starting APOSTROPHE, REVERSE SOLIDUS, COMBINING TILDE | |
714 | is prohibited. | |
f9635e06 RK |
715 | .IP |
716 | As above such sequences are not prohibited when the character is not being used | |
c0c23a60 RK |
717 | to start an escape sequence. |
718 | For instance APOSTROPHE, REVERSE SOLIDUS, REVERSE SOLIDS, COMBINING TILDE, | |
719 | APOSTROPHE is permitted. | |
f9635e06 RK |
720 | .TP |
721 | .B o | |
722 | Any of the field-splitting whitespace characters followed by a combining | |
c0c23a60 RK |
723 | character when not part of a quoted field. |
724 | For instance a line starting COLON, SPACE, COMBINING CANDRABINDU is prohibited. | |
f9635e06 RK |
725 | .IP |
726 | As above non-delimiter uses are fine. | |
727 | .TP | |
728 | .B o | |
729 | The FULL STOP characters used to quote or delimit a body. | |
730 | .PP | |
731 | Furthermore none of these characters are permitted to appear in the context of | |
732 | a canonical decomposition (i.e. they must still be present when converted to | |
c0c23a60 RK |
733 | NFC). |
734 | In practice however this is not an issue in Unicode 5.0. | |
f9635e06 RK |
735 | .PP |
736 | These rules are consistent with the observation that the split() function is | |
c0c23a60 RK |
737 | essentially a naive ASCII parser. |
738 | The implication is not that these sequences never actually appear in | |
739 | the protocol, merely that the server is not required to honor them in | |
740 | any useful way nor be consistent between versions: in current | |
f9635e06 RK |
741 | versions the result will be lines and fields that start with combining |
742 | characters and are not necessarily split where you expect, but future versions | |
743 | may remove them, reject them or ignore some or all of the delimiters that have | |
744 | following combining characters, and no notice will be given of any change. | |
460b9539 | 745 | .SH "SEE ALSO" |
746 | \fBdisorder\fR(1), | |
747 | \fBtime\fR(2), | |
748 | \fBdisorder\fR(3), | |
749 | \fBpcrepattern\fR(3) | |
750 | \fBdisorder_config\fR(5), | |
751 | \fBdisorderd\fR(8), | |
752 | \fButf8\fR(7) | |
753 | .\" Local Variables: | |
754 | .\" mode:nroff | |
755 | .\" fill-column:79 | |
756 | .\" End: |