Loader¶
Introduction¶
A loader is a string that identifies what data to extract from a file. It is used in conditions to specify what to compare against, and in action parameters as {key} placeholders for template substitution (e.g. "dest": "D:\\Photos\\{extension}").
Possible values¶
created: the creation time of the filedirectory: the canonical absolute path of the directory containing the fileempty: if the file is zero bytes, or if the directory has no contentsdirectory_name: the name of the directory containing the file (last path component only)exif: a metadata tag from the file's EXIF data (e.g.DateTimeOriginal,Make,Model...), requiresexiftoolto be installedextension: the file extension, without the leading dot (e.g.gz)filename: the filename including extensionfilesize: the size of the file on disk, in bytesid3: a metadata tag from the file's ID3 tags (e.g.Artist,Album,Title...), requiresexiftoolto be installedkind: the broad category of the file:image,audio,video,font,document,archive,application, orotherlast_modified: the last modified time of the filemime_type: the MIME type of the file (e.g.image/jpeg), detected using the file extension first, then the file contentpath: the canonical absolute path of the filescene: metadata parsed from the filename using guessit (e.g. title, season, episode), requires Python andguessitto be installed (pip install guessit)stem: the filename without its last extension (e.g.archive.tarfromarchive.tar.gz)
Template filters¶
When used as {key} placeholders in action parameters, a pipe-separated filter chain can be appended to transform the value before substitution.
A few examples:
{extension|upper}: "JPG"{stem|lower}: "photo"{stem|trim}: strips leading/trailing whitespace{created|year}/{created|month}: "2024/06"{stem|trim|upper}: filters are applied left to right
String filters¶
upper: convert to uppercaselower: convert to lowercasetrim: strip leading and trailing whitespace
Date filters¶
year: four-digit year (e.g.2024)month: zero-padded month (e.g.06)day: zero-padded day of month (e.g.03)hour: zero-padded hour, 24-hour clock (e.g.14)minute: zero-padded minute (e.g.05)format:<pattern>: custom format using Qt date/time format strings (e.g.format:yyyy-MM-dd,format:MMM yyyy)
Size filters¶
kb: convert bytes to kilobytesmb: convert bytes to megabytesgb: convert bytes to gigabytesfilesize: human-readable size string using system locale (e.g.1.5 MB,300 KB)
Fallback filter¶
default:<value> will substitute <value> if the key is missing or resolves to an empty string. Filters placed after default are applied to the fallback value as well.
A few examples:
{unknown_data|default:Unknown}: "Unknown"{stem|trim|default:file}: "file" if the stem is blank after trimming{unknown_data|default:Unknown|upper}: "UNKNOWN"
Options¶
exif¶
- tag: the exiftool tag name to read (e.g.
DateTimeOriginal,Make,Model...)
Example:
{
"data": "exif",
"tag": "DateTimeOriginal",
"glob": "2024*"
}
Template variable: {exif.DateTimeOriginal}
id3¶
- tag: the exiftool tag name to read (e.g.
Artist,Album,Title...)
Example:
{
"data": "id3",
"tag": "Artist",
"glob": "Beatles"
}
Template variable: {id3.Artist}
scene¶
Parses the filename using guessit and exposes all extracted fields as sub-fields. See the guessit documentation for the full list.
Commonly used fields:
{scene.title}: show or movie title{scene.season}: season number{scene.episode}: episode number (first episode for multi-episode files){scene.year}: year, if present in the filename
Example:
{
"data": "scene",
"tag": "season",
"in": [1]
}
extension¶
- complete: set to
trueto return the full compound extension (e.g.tar.gzinstead ofgz). Default:false
Example:
{
"data": "extension",
"complete": true,
"glob": "tar.gz"
}
stem¶
- base: set to
trueto strip all extensions (e.g.archiveinstead ofarchive.tar). Default:false
Example:
{
"data": "stem",
"base": true,
"glob": "archive"
}