This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Logging Variables

    Logging variables are placeholders that are replaced with information about the current item, the current time etc. when a text is processed. They are used in many places throughout mAirList, for example:

    • the various logging interfaces (text file, HTTP, XML, e-mail, …),
    • filenames of the File Recorder and Aircheck Recorder,
    • the dynamic columns of the playlist (see skin.ini),
    • the Dynamic Text screen object,
    • the custom text format of the library export,
    • URLs and filenames of stream and auto file container items,
    • the filename format of the playlist import (see below).

    Syntax

    A variable consists of a percent sign followed by a single character, e.g. %a for the artist. Some variables take a parameter in curly braces, e.g. %u{Album} for the value of the attribute “Album”:

    Now playing: %a - %b (%u{Year})
    

    Any text that is not a variable is copied unchanged. To insert a literal percent sign, use %%.

    Insert a ^ between the percent sign and the character in order to convert the value to upper case, e.g. %^a for the artist in upper case.

    If a variable is not available in the current context (e.g. item information when there is no item, or a file name for an item that is not a file), it is replaced with an empty string.

    General Variables

    These variables do not depend on a particular item.

    VariableDescription
    %YCurrent year, four digits
    %yCurrent year, two digits
    %MCurrent month, two digits
    %DCurrent day, two digits
    %hCurrent hour, two digits
    %mCurrent minute, two digits
    %sCurrent second, two digits
    %w, %w{n}ISO 8601 week of the year, optionally padded with leading zeros to n digits
    %W, %W{n}Year the ISO 8601 week belongs to (which may differ from the calendar year around New Year), optionally padded to n digits
    %T{format}Current date and time in a custom date/time format. Append +n or -n to the format in order to add or subtract n seconds, e.g. %T{hh:nn+30}
    %S{format}Start time of the item, in a custom date/time format. Useful when logging the end of playback
    %tTab character
    %rCarriage return (CR, ASCII 13)
    %nLine feed (LF, ASCII 10)
    %%Percent sign
    %gUnique ID of the playback operation, which is the same for the start and stop event of an item
    %R{key}Value of the runtime data variable key, as set by a script with SetRuntimeData
    %#Total number of current listeners across all encoder connections
    %xName of the computer
    %XName of the mAirList instance
    %BCurrent title, as sent with a title update (e.g. the title of a stream)
    %N, %N{n}Number of the region, optionally padded to n digits
    %N{CODE}, %N{NAME}Code or name of the region

    Item Variables

    These variables return information about the item being processed, e.g. the item that has just been started or stopped.

    VariableDescription
    %aArtist
    %bTitle
    %CComment
    %EEnd type
    %IItem type, as internal identifier (e.g. Music, StationID)
    %JItem type, as displayed in the user interface (e.g. “Station ID”)
    %u{key}Value of the attribute key, e.g. %u{Album}
    %UDatabase ID
    %VExternal ID
    %c{marker}Position of a cue marker in seconds, e.g. %c{CueIn}, %c{FadeOut}, %c{Ramp1}
    %kFilename of the item icon
    %KItem icon as Base64 encoded data

    Durations

    VariableDescription
    %lTotal duration of the item in seconds, with fractions
    %l{n}Total duration in seconds, with n decimal places
    %l{format}Total duration in a custom date/time format
    %LTotal duration as hh:nn:ss
    %p, %p{n}, %p{format}Effective playback duration (from Cue In to Cue Out, or the point where the next item is started), in the same notations as %l
    %PEffective playback duration as hh:nn:ss
    %e, %e{n}, %e{format}Actual playback duration, i.e. how long the item was actually played, in the same notations as %l. Only available when logging the end of playback
    %dActual playback duration in units of 100 nanoseconds (integer)
    %F{format}Expected finish time (current time plus effective playback duration), in a custom date/time format

    File Information

    These variables are only available for file items.

    VariableDescription
    %1Filename with full path
    %2Filename without path
    %3Filename without path and extension
    %4First character of the filename
    %i{key}Raw value of the file tag field key

    Subsequent Items

    In the logging interfaces and in the stream title of the encoders, you can access the items following the current item in the playlist, by inserting one or more + signs after the percent sign: %+a is the artist of the next item, %++a the artist of the item after that, and so on. This also works with all other item variables, e.g. %+b or %+u{Album}. For subsequent items, %S returns their expected start time.

    If you combine + with the upper case modifier, the + signs come first, e.g. %+^a.

    By default, only the next three items are considered. You can increase this limit in mAirList.ini:

    [Options]
    NextLoggingLimit=10
    

    Note that the limit applies to all subsequent items, before any filtering by item type takes place. For example, if you want to log the next three music items, and there may be up to four other items (jingles, news, advertising) in between, set the limit to 7 or higher.

    Date/Time Formats

    Variables with a date/time format parameter (%T, %S, %F, and %l, %p, %e) use the format codes of Delphi’s FormatDateTime function. The most important ones are:

    CodeMeaning
    yyyy, yyYear (four or two digits)
    mm, mMonth (with or without leading zero)
    dd, dDay (with or without leading zero)
    ddd, ddddAbbreviated or full name of the weekday
    hh, hHour (with or without leading zero)
    nn, nMinute (with or without leading zero)
    ss, sSecond (with or without leading zero)
    zzzMilliseconds
    "text"Literal text

    Note that n (not m) stands for minutes.

    mAirList supports the following additional codes:

    CodeMeaning
    epochUnix timestamp (seconds since 1970-01-01)
    hhhTotal number of hours, which may exceed 24 (useful for durations)
    sssTotal number of seconds (useful for durations)
    uTenths of a second
    vHundredths of a second

    Examples: %T{yyyy-mm-dd hh:nn:ss} gives the current date and time, e.g. 2026-10-26 14:30:00; %l{nn:ss} gives the duration of the item in minutes and seconds, e.g. 03:45.

    Playlist Import Filenames

    The filename format of the playlist import (e.g. for files from external schedulers) supports all general variables. The date and time variables (%Y, %M, %D, %h, %T{...} etc.) refer to the date and hour of the playlist being imported, not to the current time. For example, %Y%M%D.txt imports the file 20261026.txt for the playlists of October 26, 2026.

    In addition, the following variables are available:

    VariableDescription
    %BNumber of the block (e.g. advertising break) within the hour
    %2B, %3BNumber of the block, padded to two or three digits
    %N, %N{n}Number of the region, optionally padded to n digits
    %2N, %3NNumber of the region, padded to two or three digits
    %N{CODE}, %N{NAME}Code or name of the region

    Note that %B has a different meaning here than in logging, where it stands for the current title.

    HTTP Logging

    When using the HTTP logging interface with multipart/form-data, the special variable %ALBUMART can be used to send the album art of the item as binary form data, if available. It must be the only content of the respective field value, without any other text or variables.