Let's say we prefer acronyms:
"Deep Space 9" => "DS9"
"How I Met Your Mother" => "HIMYM"
1. Hardcode the name in your custom format:
Format: Select all
DS9 - {s00e00} - {t}
2. Use pattern matching and replacement:
Format: Select all
{
n.match(
'Deep Space 9' : 'DS9',
'How I Met Your Mother' : 'HIMYM'
) ?: n
}
3. Use character replacement:
Format: Select all
{
n.replace(
'Deep Space 9' : 'DS9',
'How I Met Your Mother' : 'HIMYM'
)
}
4. Use a custom lookup table:
Format: Select all
{
def table = [
'Deep Space 9' : 'DS9',
'How I Met Your Mother' : 'HIMYM'
]
table[n] ?: n
}
5. Use a custom lookup table read from an external TSV or CSV file:
Format: Select all
{
def table = csv('/path/to/names.tsv')
table[n] ?: n
}
Console Output: Select all
$ cat ~/names.tsv
Deep Space 9 DS9
How I Met Your Mother HIMYM
We prefer TSV files (TAB-separated values) because TAB cannot appear in column values.
DO NOT use Microsoft tools such as Word or Excel to edit TSV files. Use tools such as Notepad++ or Sublime Text instead.
6.
... or anything else you can come up with! Anything is possible!
Alternatively, you can use code to generically derive the series names you want from the series names you get from your chosen database:
"The IT Crowd (UK)" => "The IT Crowd"
Format: Select all
{ n.replaceTrailingBrackets() }
Format: Select all
{ n.acronym() }