Page 1 of 1

Remove Trailing Brackets AND move The|a|an to end of title?

Posted: 03 Oct 2014, 19:22
by elgallo
My current setup I am using a Mac Mini, Transmission, Flexget, CP and of course FileBot

my postprocess is as follows

Code: Select all

\#!/bin/bash
/Applications/Filebot.app/Contents/MacOS/filebot.sh -script fn:amc --output "/Volumes/Media/Incomplete/complete" --log-file amc.log --action copy  --conflict override -non-strict --def deleteAfterExtract=y music=y plex=gallo artwork=y subtitles=en clean=y "ut_dir=/Volumes/Media/Incomplete/complete/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME" "seriesFormat=/Volumes/Media/TV/{n.replaceTrailingBrackets()}/Season {s}/{n.replaceTrailingBrackets()} -S{s}E{e.pad(2)} - {t}-[{vf},{af}]{'.'+lang}" "movieFormat=/Volumes/Video/M0vies/{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} ({y}) [{certification}]/{n} ({y}) [{certification}]-[{vf},{af}]{'.'+lang}" "musicFormat=/Volumes/Media/Muzik2iTunes/TransDL/{n}/{artist} -{album}-[{pi.pad(2)}]-{t}"


RemoveTrailingBrackets

Code: Select all

{n.removeTrailingBrackets()}
works as intended
however I would like to include

Code: Select all

{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)}
with renaming, specifically The Americans (Only TV show thus far that has "the|a|an" (year) in title)

if I use "Brackets" I get
/path/to/folder/The Americans/Season X/...

however if i use "first"
/path/to/folder/Americans (2013),The/Season X/...

Ideally
/path/to/folder/Americans, The/Season X/The Americans SxxExx - title.ext

Re: Remove Trailing Brackets AND move The|a|an to end of tit

Posted: 03 Oct 2014, 19:30
by rednoah
First "brackets", then "the" on the result:

Code: Select all

{n.removeTrailingBrackets().sortName()}