14ee589150e8123eface07aa51d7de8b2cc8f546
[paraslash.git] / afs.cmd
1 OF: afs_command_list
2 SF: afs.c aft.c attribute.c
3 HC: Prototypes for the commands of the audio file selector.
4 CC: Array of commands for the audio file selector.
5 AT: server_command
6 IN: para afh server list user_list
7 SN: list of afs commands
8 TM: mood lyr img pl
9 ---
10 N: add
11 P: AFS_READ | AFS_WRITE
12 D: Add new audio files to the database.
13 U: add [-l] [-f] [-v] path1 ...
14 H: Each given path may be either the full path to an audio file, or the full path
15 H: of a directory. In case of a directory, all audio files in that directory
16 H: are added recursively.
17 H:
18 H: Options:
19 H:
20 H: -a Add all files. The default is to add only files ending in a known suffix
21 H: for a supported audio format.
22 H:
23 H: -l Add files lazily. If a file already exists in the database, skip this file.
24 H: This operation is really cheap. Use it when adding large directories if only a
25 H: few files where added.
26 H:
27 H:-f Force adding/updating. Recompute the audio format handler data
28 H: even if a file with the same path and the same hash value exists.
29 H:
30 H: -v Verbose mode. Print what is being done.
31 ---
32 N: init
33 P: AFS_READ | AFS_WRITE
34 D: Initialize the osl tables for the audio file selector.
35 U: init [table_name ...]
36 H: When invoked without arguments, this command creates all tables. Otherwise
37 H: only the tables given by table_name... are created.
38 ---
39 N: afs_ls
40 P: AFS_READ
41 D: List audio files.
42 U: ls [-l[s|l|v|m]] -p -a -r -s{p|s|l|n|f|c|i|y|b|d|a} [pattern...]
43 H: Print a list of all audio files matching pattern.
44 H:
45 H: Options:
46 H:
47 H: -l Change listing mode. Defaults to short listing if not given.
48 H: -ls: short listing mode
49 H: -ll: long listing mode (equivalent to -l)
50 H: -lv: verbose listing mode
51 H: -lm: mbox listing mode
52 H:
53 H: -p List full path of audio file. If not specified, only the basename
54 H: of each file is printed.
55 H:
56 H: -a List only file that are admissible with respect to the current mood or
57 H: playlist.
58 H:
59 H: -r Reverse sort order.
60 H:
61 H: -s Change sort order. Defaults to alphabetical path sort if not given.
62 H:
63 H: -sp: sort by path.
64 H:
65 H: -sl: sort by last played time.
66 H:
67 H: -ss: sort by score (implies -a).
68 H:
69 H: -sn: sort by num played count.
70 H:
71 H: -sf: sort by frequency.
72 H:
73 H: -sc: sort by number of channels.
74 H:
75 H: -si: sort by image id.
76 H:
77 H: -sy: sort by lyrics id.
78 H:
79 H: -sb: sort by bit rate.
80 H:
81 H: -sd: sort by duration.
82 H:
83 H: -sa: sort by audio format.
84 ---
85 N: lsatt
86 P: AFS_READ
87 D: List attributes
88 U: lsatt [-i] [-l] [-r] [pattern]
89 H:
90 H: Print the list of all defined attributes which match the given pattern. If no
91 H: pattern is given, the full list is printed.
92 H:
93 H: Options:
94 H:
95 H: -i Sort attributes by id. The default is to sort alphabetically by name.
96 H:
97 H: -l Print a long listing containing both identifier and attribute name. The
98 H: default is to print only the name.
99 H:
100 H: -r Reverse sort order.
101 ---
102 N: setatt
103 P: AFS_READ | AFS_WRITE
104 D: Set attribute(s) for all files matching a pattern.
105 U: setatt attribute{+|-}... pattern
106 H: Set ('+') or unset ('-') the given attributes for all audio files matching
107 H: pattern. Example:
108 H:
109 H: setatt rock+ punk+ classic- '*foo.mp3'
110 H:
111 H: sets the 'rock' and the 'punk' attribute but unsets the 'classic'
112 H: attribute of all files ending with 'foo.mp3'.
113 ---
114 N: addatt
115 P: AFS_READ | AFS_WRITE
116 D: Add new attribute(s).
117 U: addatt attribute1...
118 H: This adds new attributes to the attribute table. At most 64 attributes
119 H: may be defined.
120 ---
121 N: check
122 P: AFS_READ
123 D: Run integrity checks against osl tables.
124 U: check [-a] [-m] [-p]
125 H: Check the audio file table, the mood definitions and all defined playlists and
126 H: report any inconsistencies found.
127 H:
128 H: Options:
129 H:
130 H: -a Run audio file table checks. Checks for entries in the audio file
131 H: table which are not present in the file system. Moreover, it checks
132 H: whether the lyrics id and all entries in the audio file table are
133 H: valid.
134 H:
135 H: -m Run syntax checks on all defined moods in the mood table.
136 H:
137 H: -p Check all playlists for lines that correspond to files not contained
138 H: in the audio file table.
139 H:
140 H: If called without arguments, all three checks are run.
141 ---
142 N: rmatt
143 P: AFS_READ | AFS_WRITE
144 D: Remove attribute(s).
145 U: rmatt pattern...
146 H: Remove all attributes matching any given pattern. All information
147 H: about this attribute in the audio file table is lost.
148 ---
149 N: afs_rm
150 P: AFS_READ | AFS_WRITE
151 D: Remove entries from the audio file table.
152 U: rm [-v] [-f] [-p] pattern...
153 H: Delete all entries in the audio file table that match any given pattern.
154 H: Note that affects the table entries only; paraslash won't touch your
155 H: audio files in any way.
156 H: Options:
157 H:
158 H: -v Verbose mode. Explain what is being done.
159 H:
160 H: -f Force mode. Ignore nonexistent files. Don't complain if nothing
161 H: was removed.
162 H:
163 H: -p Pathname match. Match a slash in the path only with a slash
164 H: in pattern and not by an asterisk (*) or a question mark
165 H: (?) metacharacter, nor by a bracket expression ([]) containing
166 H: a slash (see fnmatch(3)).
167 ---
168 N: touch
169 P: AFS_READ | AFS_WRITE
170 D: Manipulate the afs data for all audio files matching a pattern.
171 U: touch [-n numplayed] [-l lastplayed] [-y lyrics_id] [-i image_id] [-v] [-p] pattern
172 H: If no option is given, lastplayed is set to the current time and numplayed is
173 H: increased by one. Otherwise, only the given options are taken into account.
174 H:
175 H: Options:
176 H:
177 H: -n Set numplayed count. The number of times afs has selected this
178 H: audio file for streaming.
179 H:
180 H: -l Set lastplayed time. The last time this audio file was selected.
181 H: Must be given as the number of seconds since the epoch. Example:
182 H:
183 H: touch -l $(date +%s) file
184 H:
185 H: sets the lastplayed time of 'file' to the current time.
186 H:
187 H: -y Set the lyrics id. Specify the lyrics data file associated with
188 H: this audio file.
189 H:
190 H: -i Set the image id. Same as -y, but sets the image.
191 H:
192 H: -v Verbose mode. Explain what is being done.
193 H:
194 H: -p Pathname match. Match a slash in the path only with a slash
195 H: in pattern and not by an asterisk (*) or a question mark
196 H: (?) metacharacter, nor by a bracket expression ([]) containing
197 H: a slash (see fnmatch(3)).
198 ---
199 N: cpsi
200 P: AFS_READ | AFS_WRITE
201 D: Copy audio file selector info.
202 U: cpsi [-a] [-y] [-i] [-l] [-n] [-v] source pattern...
203 H: If no option, or only the -v option is given, all fields of the audio file
204 H: selector info are copied to all files matching pattern. Otherwise, only the
205 H: given options are taken into account.
206 H:
207 H: Options:
208 H:
209 H: -a Copy attributes.
210 H:
211 H: -y Copy the lyrics id.
212 H:
213 H: -i Copy the image id.
214 H:
215 H: -l Copy the lastplayed time.
216 H:
217 H: -n Copy the numplayed count.
218 H:
219 H: -v Verbose mode.
220 ---
221 T: add
222 N: add@member@
223 O: int com_add@member@(int fd, int argc, char * const * const argv);
224 P: AFS_READ | AFS_WRITE
225 D: Read data from stdin and add it as a blob to an osl table.
226 U: add@member@ @member@_name
227 H: Each command of this family reads arbitrary binary data from stdin and sends
228 H: that data to the audio file selector process. The afs process then creates a
229 H: new blob for the data in the corresponding osl table. Example:
230 H:
231 H: addimg foo.jpg < bar.jpg
232 H:
233 H: adds the contents of the file 'bar.jpg' as a blob named 'foo.jpg' to the image
234 H: table. The names of the blobs of a table must be unique, i.e. it is an error
235 H: if an entry named 'foo.jpg' already exists.
236 ---
237 T: cat
238 N: cat@member@
239 O: int com_cat@member@(int fd, int argc, char * const * const argv);
240 P: AFS_READ
241 D: Dump the contents of a blob to stdout.
242 U: cat@member@ @member@_name
243 H: These commands may be used to retrieve the blob identified by the given name from
244 H: the corresponding osl table to which they were previously added.
245 ---
246 T: ls
247 N: ls@member@
248 O: int com_ls@member@(int fd, int argc, char * const * const argv);
249 P: AFS_READ
250 D: List blobs of an osl table matching a pattern.
251 U: ls@member@ [-i] [-l] [-r] [pattern]
252 H: Print a list of the names of all blobs in the corresponding osl table which
253 H: match the given pattern. If no pattern is given, the full list is printed.
254 H:
255 H: Options:
256 H:
257 H: -i Sort attributes by id. The default is to sort alphabetically by name.
258 H:
259 H: -l Print a long listing containing both identifier and attribute name. The
260 H: default is to print only the name.
261 H:
262 H: -r Reverse sort order.
263 ---
264 T: rm
265 N: rm@member@
266 O: int com_rm@member@(int fd, int argc, char * const * const argv);
267 P: AFS_READ | AFS_WRITE
268 D: Remove blob(s) from an osl table.
269 U: rm@member@ pattern...
270 H: Remove all blobs from the corresponding table which match any given pattern.
271 ---
272 T: mv
273 N: mv@member@
274 O: int com_mv@member@(int fd, int argc, char * const * const argv);
275 P: AFS_READ | AFS_WRITE
276 D: Rename a blob.
277 U: mv@member@ old_@member@_name new_@member@_name
278 H: Rename the blob identified by the first name as the second name.