Code: Select all
{n.colon(' - ').replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} {'('+y+')'}
Code: Select all
{n.colon(' - ').replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} {'('+y+')'}
Code: Select all
{ny.split(':')*.sortName('$2, $1').join(' - ')}
Code: Select all
Lion King 2, The - Simba's Pride (1998)
Interesting... With that, I get output like below. So it appears to work exactly how I want unless there is no colon/hyphen.rednoah wrote: ↑20 May 2019, 15:42 e.g.Code: Select all
{ny.split(':')*.sortName('$2, $1').join(' - ')}
Code: Select all
Lion King 2, The - Simba's Pride (1998)
Note that this won't work well for contrived corner cases like The Name: The Title where both The would be shuffled around, and not just the first one.
Code: Select all
Chronicles of Narnia, The - The Voyage of the Dawn Treader (2010).mkv
Chronicles of Narnia, The - Prince Caspian (2008).mkv
Chronicles of Riddick (2004), The.mkv
Matrix (1999), The.mkv
Quiet Place (2016), A.mkv
Code: Select all
{n.split(':')*.sortName('$2, $1').join(' - ')} ({y})
Thanks! I just figured that out before hopping back on here. Thanks for your help!rednoah wrote: ↑20 May 2019, 18:25 Fixed:Code: Select all
{n.split(':')*.sortName('$2, $1').join(' - ')} ({y})
Code: Select all
{n.replaceFirst'^(The|An|A|Der|Die|Das|Das|Eine|Ein|Une|Un) '}
after($1)($2)
e.g. (not tested)$2, $1
Code: Select all
{n.replaceFirst(/^(?i)(The|An|A|Der|Die|Das|Eine|Ein|Une|Un)\s(.+)/, /$2, $1/)} {'('+y+')'}
Code: Select all
filebot --db TheTVDB --action test --lang de -no-xattr -non-strict --format "/media/Video/Serien/{n =~ /^(?i)[a-z]/ ? n[0] : '#'}/{n.replaceFirst(/^(?i)(The|An|A|Der|Die|Das|Eine|Ein|Une|Un)\s(.+)/, /$2, $1/)} {'('+y+')'}/Staffel {s.pad(2)}/{n} - {s00e00} - {t}" -rename /tmp/themaninthehighcastle.s01e01.720p.german.mkv
Code: Select all
Illegal Argument: java.nio.file.NoSuchFileException: /tmp/themaninthehighcastle.s01e01.720p.german.mkv (/tmp/themaninthehighcastle.s01e01.720p.german.mkv)
Rename episodes using [TheTVDB]
Auto-detected query: [The Man in the High Castle, themaninthehighcastle]
Fetching episode data for [The Man in the High Castle]
[TEST] from [/tmp/themaninthehighcastle.s01e01.720p.german.mkv] to [/media/Video/Serien/T/, (2015)/Staffel 01/The Man in the High Castle - S01E01 - Die neue Welt.mkv]
Processed 1 files