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

Any questions? Need some help?
Post Reply
elgallo
Posts: 40
Joined: 29 Apr 2014, 10:33

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

Post 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
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah »

First "brackets", then "the" on the result:

Code: Select all

{n.removeTrailingBrackets().sortName()}
:idea: Please read the FAQ and How to Request Help.
Post Reply