๐Ÿ“ File Templating

November 21, 2025 ยท View on GitHub

Templates are text strings that describe folder and file structure. They use placeholders (in {curly_braces}) that get replaced with actual metadata values from:

  • Track / Video โ†’ item
  • Album โ†’ album
  • Playlist โ†’ playlist
  • Plus any custom fields

A template like:

{album.artist}/{album.title}/{item.title}

becomes this:

Daft Punk/Discovery/Harder Better Faster Stronger

๐Ÿงฉ Template Variables

Each object type exposes fields you can use inside templates.

item (Track or Video)

FieldDescriptionExampleType
item.idTrack/Video ID123456int
item.titleTitleHarder Better Faster Strongerstr
item.title_versionTitle + version (if present)One More Time (Radio Edit)str
item.numberTrack number3int
item.volumeDisc/volume number1int
item.versionVersion string (track only)Remasteredstr
item.copyrightCopyright info (track only)ยฉ 2023 Sony Musicstr
item.bpmBeats per minute (if available)120int
item.isrcISRC code (track only)USQX91501234str
item.qualityAudio/video qualityHIGHstr
item.artistPrimary artist nameDaft Punkstr
item.artistsAll main artistsDaft Punk, Pharrell Williamsstr
item.featuresFeatured artistsPharrell Williamsstr
item.artists_with_featuresMain + featured artistsDaft Punk, Pharrell Williamsstr
item.explicitExplicit contentEstr
item.dolby:(Dolby Atmos)Dolby Atmos (track only, UserFormat)(Dolby Atmos)str

album

FieldDescriptionExampleType
album.idAlbum ID98765int
album.titleAlbum titleDiscoverystr
album.artistPrimary artistDaft Punkstr
album.artistsAll main artistsDaft Punkstr
album.dateRelease date2001-03-13datetime
album.explicitExplicit contentcleanstr
album.master:[MAX]Is album max quality (UserFormat)[MAX]str
album.releaseRelease typeALBUM/EP/SINGLEstr

playlist

FieldDescriptionExampleType
playlist.uuidPlaylist unique IDb8f1d9f8-...str
playlist.titlePlaylist nameMy Favoritesstr
playlist.indexTrack index within playlist5int
playlist.createdCreation date (datetime)2024-01-15 10:42:00datetime
playlist.updatedLast updated date (datetime)2024-03-02 09:00:00datetime

Note

Tidal API does not provide full album data for playlist tracks, if you are downloading a playlist with template that contains {album...}, then tiddl is making additional request to the API to fetch album data for a track. The download may take a little longer but it's not a big deal - just one more request for every playlist track. If there are multiple tracks from the same album, then the album data is cached locally, and there is only one request per album. Related issue: #217


Explicit

FormatTrue ValueFalse Value
.explicitE
.explicit:longexplicit
.explicit:fullexplicitclean

User Format

You can format UserFormat fields how you want:

FormatTrue ValueFalse Value
item.dolby:DD
item.dolby:DOLBYDOLBY
item.dolby:dolbydolby
album.master:(Max Quality)[Max Quality]

extra and custom fields

You can also use:

  • now โ†’ current datetime
  • Any key passed as extra in code.

๐Ÿงผ Sanitization

All template segments are sanitized:

  • Invalid filesystem characters are removed or replaced.
  • Empty placeholders are skipped cleanly.
  • Each path component is treated separately (split by /).

โš™๏ธ Configuration Example

Your [templates] section in config.toml defines templates per media type.

[templates]
default = "{album.artist}/{album.title}/{item.title}"
track = "tracks/{item.id}"
video = "videos/{item.title}"
album = "artists/{album.artist}/{album.title}/{item.title}"
playlist = "{playlist.title}/{playlist.index}. {item.artist} - {item.title}"
mix = "mixes/{mix_id}/{item.artist} - {item.title}"

If no specific template is set, the default one is used.


๐Ÿง  Tips

  • You can format datetime fields, e.g. {album.date:%Y-%m-%d}.
  • You can build nested folders safely using / separators.
  • You can format string and integer fields, learn more

๐Ÿ–ฅ๏ธ Source Code

Source code is located at /tiddl/core/utils/format.py