Libation/Documentation/NamingTemplates.md
Michael Bucari-Tovo 7d806e0f3e Increase tag template options for contributor and series types
- Add template tag support for multiple series
- Add series ID and contributor ID to template tags
- <first author> and <first narrator> are now name types with name formatter support
- Properly import contributor IDs into database
- Updated docs
2025-03-25 09:34:57 -06:00

9.4 KiB
Raw Blame History

Download Libation

If you found this useful, tell a friend. If you found this REALLY useful, you can click here to PayPal.me

...or just tell more friends. As long as I'm maintaining this software, it will remain free and open source.

Naming Templates

File and Folder names can be customized using Libation's built-in tag template naming engine. To edit how folder and file names are created, go to Settings > Download/Decrypt and edit the naming templates. If you're splitting your audiobook into multiple files by chapter, you can also use a custom template to set each chapter's title metadata tag by editing the template in Settings > Audio File Options.

These templates apply to both GUI and CLI.

Table of Contents

Template Tags

These are the naming template tags currently supported by Libation.

Property Tags

These tags will be replaced in the template with the audiobook's values.

Tag Description Type
<id> Audible book ID (ASIN) Text
<title> Full title with subtitle Text
<title short> Title. Stop at first colon Text
<audible title> Audible's title (does not include subtitle) Text
<audible subtitle> Audible's subtitle Text
<author> Author(s) Name List
<first author> First author Name
<narrator> Narrator(s) Name List
<first narrator> First narrator Name
<series> All series to which the book belongs (if any) Series List
<first series> First series Series
<series#> Number order in series (alias for <first series[{#}]> Number
<bitrate> File's original bitrate (Kbps) Number
<samplerate> File's original audio sample rate Number
<channels> Number of audio channels Number
<account> Audible account of this book Text
<account nickname> Audible account nickname of this book Text
<locale> Region/country Text
<year> Year published Number
<language> Book's language Text
<language short> Book's language abbreviated. Eg: ENG Text
<file date> File creation date/time. DateTime
<pub date> Audiobook publication date DateTime
<date added> Date the book added to your Audible account DateTime
<ch count> Number of chapters Number
<ch title> Chapter title Text
<ch#> Chapter number Number
<ch# 0> Chapter number with leading zeros Number

Does not support custom formatting

Only valid for Chapter Filename and Chapter Tile Metadata

To change how these properties are displayed, read about custom formatters

Conditional Tags

Anything between the opening tag (<tagname->) and closing tag (<-tagname>) will only appear in the name if the condition evaluates to true.

Tag Description Type
<if series->...<-if series> Only include if part of a book series or podcast Conditional
<if podcast->...<-if podcast> Only include if part of a podcast Conditional
<if bookseries->...<-if bookseries> Only include if part of a book series Conditional
<if podcastparent->...<-if podcastparent> Only include if item is a podcast series parent Conditional

Only affects the podcast series folder naming if "Save all podcast episodes to the series parent folder" option is checked.

For example, <if podcast-><series><-if podcast> will evaluate to the podcast's series name if the file is a podcast. For audiobooks that are not podcasts, that tag will be blank.

You can invert the condition (instead of displaying the text when the condition is true, display the text when it is false) by playing a '!' symbol before the opening tag name.

As an example, this folder template will place all Liberated podcasts into a "Podcasts" folder and all liberated books (not podcasts) into a "Books" folder.

<if podcast->Podcasts<-if podcast><!if podcast->Books<-if podcast>\<title>

Tag Formatters

Text, Name List, Number, and DateTime tags can be optionally formatted using format text in square brackets after the tag name. Below is a list of supported formatters for each tag type.

Text Formatters

Formatter Description Example Usage Example Result
L Converts text to lowercase <title[L]> a study in scarlet a sherlock holmes novel
U Converts text to uppercase <title short[U]> A STUDY IN SCARLET

Series Formatters

Formatter Description Example Usage Example Result
{N | # | ID} Formats the series using
the series part tags.
{N} = Series Name
{#} = Number order in series
{ID} = Audible Series ID

Default is {N}
<first series>
<first series[{N}]>
<first series[{N}, {#}, {ID}]>
Sherlock Holmes
Sherlock Holmes
Sherlock Holmes, 1, B08376S3R2

Series List Formatters

Formatter Description Example Usage Example Result
separator() Speficy the text used to join
multiple series names.

Default is ", "
<series[separator(; )]> Sherlock Holmes; Some Other Series
format({N | # | ID}) Formats the series properties
using the name series tags.
See Series Formatter Usage above.
<series[format({N}, {#})
separator(; )]>
<author[format({L}, {ID}) separator(; )]>
Sherlock Holmes, 1; Some Other Series, 1
herlock Holmes, B08376S3R2; Some Other Series, B000000000
max(#) Only use the first # of series

Default is all series
<series[max(1)]> Sherlock Holmes

Name Formatters

Formatter Description Example Usage Example Result
{T | F | M | L | S | ID} Formats the human name using
the name part tags.
{T} = Title (e.g. "Dr.")
{F} = First name
{M} = Middle name
{L} = Last Name
{S} = Suffix (e.g. "PhD")
{ID} = Audible Contributor ID

Default is {P} {F} {M} {L} {S}
<first narrator[{L}, {F}]>
<first author[{L}, {F} _{ID}_]>
Fry, Stephen
Doyle, Arthur _B000AQ43GQ_;
Fry, Stephen _B000APAGVS_

Name List Formatters

Formatter Description Example Usage Example Result
separator() Speficy the text used to join
multiple people's names.

Default is ", "
<author[separator(; )]> Arthur Conan Doyle; Stephen Fry
format({T | F | M | L | S | ID}) Formats the human name using
the name part tags.
See Name Formatter Usage above.
<author[format({L}, {F})
separator(; )]>
<author[format({L}, {F}
_{ID}_) separator(; )]>
Doyle, Arthur; Fry, Stephen
Doyle, Arthur _B000AQ43GQ_;
Fry, Stephen _B000APAGVS_
sort(F | M | L) Sorts the names by first, middle,
or last name

Default is unsorted
<author[sort(M)]> Stephen Fry, Arthur Conan Doyle
max(#) Only use the first # of names

Default is all names
<author[max(1)]> Arthur Conan Doyle

Number Formatters

For more custom formatters and examples, see this guide from Microsoft.

Formatter Description Example Usage Example Result
[integer] Zero-pads the number <bitrate[4]>
<series#[3]>
<samplerate[6]>
0128
001
044100
0 Replaces the zero with the corresponding digit if one
is present; otherwise, zero appears in the result string.
<series#[000.0]> 001.0
# Replaces the "#" symbol with the corresponding digit if one
is present; otherwise, no digit appears in the result string
<series#[00.##]> 01

Date Formatters

Form more standard formatters, see this guide from Microsoft.

Standard DateTime Formatters

Formatter Description Example Usage Example Result
s Sortable date/time pattern. <file date[s]> 2023-02-14T13:45:30
Y Year month pattern. <file date[Y]> February 2023

Custom DateTime Formatters

You can use custom formatters to construct customized DateTime string. For more custom formatters and examples, see this guide from Microsoft.

Formatter Description Example Usage Example Result
yyyy 4-digit year <file date[yyyy]> 2023
yy 2-digit year <file date[yy]> 23
MM 2-digit month <file date[MM]> 02
dd 2-digit day of the month <file date[yyyy-MM-dd]> 2023-02-14
HH
mm
The hour, using a 24-hour clock from 00 to 23
The minute, from 00 through 59.
<file date[HH:mm]> 14:45