Miscellaneous Functions
- See also: Expression Language and Function Index
The functions in this section are varied and have specialized applicability. Some are primarily used internally by MC to generate values available in various Library fields.
AlbumArtist(…)
- Returns a file's calculated album artist.
Description | albumartist()
The AlbumArtist() function calculates the album artist value used in various views and fields. It is used to populate the Library field album artist (auto) with its value. Either the field or AlbumArtist() can be used. |
---|---|
Examples | albumartist()
Returns the value present in the album artist (auto) field. Additional Examples |
AlbumKey(…)
- Returns a unique album key for a file.
Description | albumkey()
The AlbumKey() function returns "[album artist (auto)] - [album]". It is a convenience function, used to return the generally unique album / artist combination string used to distinguish between two like-named albums such as "Greatest Hits". |
---|---|
Examples | albumkey()
For an album named Greatest Hits and an album artist (auto) of The Eagles, returns The Eagles - Greatest Hits. |
AlbumType(…)
- Returns the album type for a file.
Description | albumtype()
The AlbumType() function returns a description regarding an album's completeness and its quantity of artists. It is used to populate the Library field album type with its value. Either the field or AlbumType() can be used. |
---|---|
Examples | albumtype()
Returns, for example, Single artist (complete), or Multiple artists (incomplete). |
AudioAnalysisState(…)
- Returns the state of audio analysis for a file.
Description | audioanalysisstate()
The AudioAnalysisState() function returns a file's state of audio analysis. It can be used to determine if audio analysis (Library Tools > Analyze Audio...) should be performed on a media file. The AudioAnalysisState() function will return a string indicating the state of analysis. Possible values are currently:
| ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Examples | audioanalysisstate()
Returns, for example, Needed for files that require audio analysis, or N/A if the file type does not support audio analysis. Additional Examples |
Char(…)
- Returns a character from the numeric code of that character
Description | Char(Numeric Number Code)
Char() has unicode support, however, only decimal values are supported. If you require a Hex to Decimal convertor, try unicode-search.net, or search for an alternative online. |
---|---|
Examples | Char(189)
Char(9679)
|
CustomData(…)
- Returns internal data to the expression language.
Description | customdata(mode)
The CustomData() function supports returning Media Center internal data to the expression language. Currently the only supported mode provides a file's row number in a file list, which is useful in the Rename, Move & Copy tool to assist in numbering files. It can also be used in expressions in a playlist to obtain the file's sequence number. Available mode values:
| ||
---|---|---|---|
Examples | Spring_Break_Bash_padnumber(customdata(#), 4)
In the Rename, Move & Copy tool, each consecutive file would be named Spring_Break_Bash_ followed by a four digit, zero-padded number starting at 0001. |
FilePlaylists()
- Returns a list of playlists a file belongs to.
Description | FilePlaylists()
This function returns the list of playlists a file is in separated by semi-colons. |
---|---|
Examples | FilePlaylists()
Using this will return a list of all the playlists a file is in, separated by semi-colons. In and of itself, you might think that this is not 'all that', however, remember that we can combine this with other functions, thus giving us the ability to create expressions with playlist rules. A simple example would be: [=IsEqual(fileplaylists(),genre,8)]=1 which when used in the search bar, will return all files that appear on any playlist containing 'Genre' in its name |
Literal(…)
- Returns a string as given without any formatting or processing
Description | Literal(String)
Literal() returns a given string as-is without any formatting or processing |
---|---|
Examples | If(IsEqual([Artist], Queen, 1), Literal(If all music was Queen, I would be 10/10ths happy!), Literal(This is not Queen, which makes me sad. :-/))
/*Left(Theater,3) returns/* Left(Theater,3)
|
Repeat(…)
- Repeats a given string a specified number of times
Description | Repeat(Value, Count)
Repeats "Value", "Count" number of times. |
---|---|
Examples | Repeat(*,10)
Repeat(Ha,5)
|
Row(…)
- Returns the row number of a list entry
Description | Row()
Row() returns the row number for each item in a list. |
---|---|
Examples | Row()
|
Size(…)
- Returns a file's size in a format specific to the media type.
Description | size()
The Size() function returns media size information specific to the particular media type. It is used to populate the Library fields duration and dimensions with their values. Either the field or Size() can be used. Type of information reported by size for the file's media type:
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Examples | size()
Returns values such as 400x225 for images, or 3:09 for audio files. |
Translate(…)
- Converts an English string found in the program to the current language selected in the language menu
Description | Translate(String)
When using Media Center with any language other than English, the Translate() function can be used to translate an English string in the program to the current language. |
---|---|
Examples | Translate(Keywords)
|
TreeNode(…)
- Returns the selected tree path.
Description | TreeNode(Mode)
Available mode values:
| ||||||
---|---|---|---|---|---|---|---|
Examples | TreeNode()
What this function does is self-explanatory. This conversation on the Interact forums demonstrates a practical use-case scenario. |
TVInfo(…)
- Miscellaneous television and other pre-formatted information.
Description | tvinfo(type)
The TVInfo() function is multi-purpose, and returns a specific type of information about television recordings, programs, and pre-formatted informational strings for use in captions, thumbnails, grouping, etc. Available type values:
| ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Examples | tvinfo(namedisplay)
Returns formatted name and series output. If the file has no [series] value, only [name] is output. |