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