Overview

task.conf defines 'tasks' present on the server. Currently a task is a combination of directory settings and playlist options. In the future more may well be added here.

Paths

A lot of the following details are concerned with generating the eventual directory and file name of a file. There are a few rules that govern this behaviour:

Sections

Global

Key Example value Description
base /media/ The path specified here is prefixed to all relative paths in the other sections. This key must be present but may be left blank.

Other

Each of the other sections in the task file define a task. The section name is used as the name of the task.

Key Example value Description
base audio/discs/%DISC-ARTIST_THE% - %DISC-TITLE%/ Optional field. If a relative path is used it is suffixed to the global base value to form the base path for this task. If an absolute path is used it overrides global base.
class-allow mp3-high,lossless-flac Comma separated list of classes to allow for this task. If omitted any class can be used.
description Albums and singles A description of the task.
file %TITLE% The final file name of the file.
file-multi %TITLE% - %ARTIST% Optional field. If specified this path will be used for tasks that have the multi field set. This is set by wagdisc for discs declared as being multi-artist.
playlist-file playlist.m3u The name of the playlist to create. Playlists are simply one file name per line formatted files. Optional field.
process-encoded-x clear_old_tags %FILE% Processes the encoded file before tagging.
process-final-x touch "%CONFIG/state/file/dir%.updated" Runs commands after encoded file has been moved.
process-raw-x normalize %FILE% Processes the decompressed file. Skipped if file is not being encoded.
type audio The type of the task. Currently always audio.

Processing tasks

The fields process-encoded-x, process-final-x and process-raw-x allow arbitrary processing instructions to be carried out at various stages of encoding. In each case x is a number which determines the order in which the instructions within that group are carried out. Note that task 1 is carried out first, consecutive numbers are not required and numbers cannot be duplicated within a group.

For process-raw %IN% and %FILE% are set to the name of the decompressed/original WAV file. For process-encoded these fields reference the encoded file. In each case %OUT% can be used for commands that require separate in and out files, e.g. sox %IN% %OUT% reverse. process-final does not define %IN%, %FILE% or %OUT%.

All stages have access to the task description data, as with paths, and configuration file settings.

State variables

Additionally there is a memory-only configuration file called 'state' which provide extra information. Some of these fields are only available in the process-final stage.

Section Key Description
decode command The command used to decode the file.
decode commandfull The command used to decode the file including stream re-direction.
encode command The command used to encode the file.
encode commandfull The command used to encode the file including stream re-direction.
error last Gives extra information about an error.
file basename The final file-name (includes uniqueness padding and extension).
file dir The final absolute directory used for the file.
file name The selected file-name used (includes uniqueness padding, excludes extension).
file name-choice The preferred choice for the file-name (excludes uniqueness padding and extension).
file path The final absolute path to the encoded file.
playlist basename The final-name used for the playlist.
playlist dir The final absolute directory used for the playlist.
playlist path The final absolute path to the playlist.

Note that playlist fields are only created if a playlist was written to.