Convert custom formats for AMC

All about user-defined episode / movie / file name format expressions
Post Reply
g3rman
Donor
Posts: 18
Joined: 24 Oct 2013, 16:14

Convert custom formats for AMC

Post by g3rman »

I'm currently renaming somewhat manually using scripts in Windows and looking to move to more automated functionality with AMC.

Any thoughts on how to translate this to AMC would be appreciated!

My current folder structure for the watch folder is as follows:
  • British TV
    Comedy,Documentary, etc
  • TV Shows
  • Australian TV
    Comedy,Documentary, etc
  • Movies
My main struggle is figuring out how write a single, simple expression to retain the file structure so that:

/watch/TV Shows/alf-s01e01.mkv
results in
/output/TV Shows/Alf/Series 1/Alf - S01E01

and

/watch/British TV/Drama/sanditon-s01e01.mkv
results in
/output/British TV/Drama/Sanditon/Series 1/Sanditon - S01E01.mkv

My current setup renames using the following command lines:

Code: Select all

filebot --db TheTVDB -extract -rename -r -non-strict "\input\British TV" --format "\output\British TV\{folder.path.match(/Arts and Culture|Comedy|Documentary|Drama|Game Show|Horror|Kids|Motoring|Music|Mystery|Planes and Trains|Property|Radio|Reality|Sci-Fi|Soaps|Special Events|Talkshow|Travel/)}\{n.replaceAll(':|\\?',' -').replaceAll('(?i)\\s-\\s\\(uk\\)|(?i)\\s\\(uk\\)')}\Series {s}\{n.replaceAll(':|\\?',' -').replaceAll('(?i)\\s-\\s\\(uk\\)|(?i)\\s\\(uk\\)')} - {S00E00}"

Code: Select all

filebot --db TheTVDB -extract -rename -r -non-strict "\input\TV Shows" --format "\output\TV Shows\{n.replaceAll(':',' -')}\Series {s}\{n.replaceAll(':',' -')} - {S00E00}"

Code: Select all

filebot --db TheTVDB -extract -rename -r -non-strict "\input\Australian TV" --format "\output\Australian TV\{folder.path.match(/Arts and Culture|Comedy|Documentary|Drama|Game Show|Horror|Kids|Motoring|Music|Mystery|Planes and Trains|Property|Radio|Reality|Sci-Fi|Soaps|Special Events|Talkshow|Travel/)}\{n.replaceAll(':|\\?',' -').replaceAll('(?i)\\s-\\s\\(uk\\)|(?i)\\s\\(uk\\)')}\Series {s}\{n.replaceAll(':|\\?',' -').replaceAll('(?i)\\s-\\s\\(uk\\)|(?i)\\s\\(uk\\)')} - {S00E00}"

Code: Select all

filebot --db TheMovieDB -extract -rename -r -non-strict "\input\Movies" --output "\output\Movies\"
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Convert custom formats for AMC

Post by rednoah »

What's wrong with your current solution? What benefits do you expect from using the amc script over simple filebot -rename calls? You already have non-interactive commands, so it's already fully automated, just need to have them called automatically somehow, via scheduler, via file system events, on demand by 3rd party software, etc.


:idea: If you're set on using the amc script then I'd still recommend doing 4 separate calls for your 4 separate input folders, so that you can more easily force movie / episode mode and output folder for the task at hand:

Code: Select all

"/input/TV Shows" --output "/output/TV Shows" --def ut_label=TV

Code: Select all

"/input/Movies" --output "/output/Movies" --def ut_label=Movie


:idea: The amc script uses the same formats, except you need to use --def seriesFormat / --def movieFormat / etc. You'll want to specify the output folder via --output though, so that your --format includes only the variable parts, this applies to both amc script calls and filebot -rename calls just the same, e.g.

Code: Select all

--output "\output\TV Shows" --def seriesFormat="{n.replaceAll(':',' -')}\Series {s}\{n.replaceAll(':',' -')} - {S00E00}"
:idea: Please read the FAQ and How to Request Help.
g3rman
Donor
Posts: 18
Joined: 24 Oct 2013, 16:14

Re: Convert custom formats for AMC

Post by g3rman »

I'm switching from using a Windows Powershell script to an Unraid Docker container.
Since all the variables are defined in the docker setup I wanted to convert my existing setup to use the capabilities of AMC.
After experimenting I found that the following configuration provides exactly the result I was looking for:

Movie Format:

Code: Select all

{folder.path.match(/Movies/)}/{n}
TV Series Format:

Code: Select all

{folder.path.match(/TV Shows|British TV|Australian TV/)}/{folder.path.match(/Arts and Culture|Comedy|Documentary|Drama|Game Show|Horror|Kids|Motoring|Music|Mystery|Planes and Trains|Property|Radio|Reality|Sci-Fi|Soaps|Special Events|Talkshow|Travel/)}\{n.replaceAll(':|\\?',' -').replaceAll('(?i)\\s-\\s\\(uk\\)|(?i)\\s\\(uk\\)')}\Series {s}\{n.replaceAll(':|\\?',' -').replaceAll('(?i)\\s-\\s\\(uk\\)|(?i)\\s\\(uk\\)')} - {S00E00}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Convert custom formats for AMC

Post by rednoah »

Movies/{n} is probably better, because you probably always want a relative Movies folder, and never want to write files into the file system root, e.g. absolute file path /Avatar.mp4, in cases where the original file path happens to not contain the keyword Movies.
:idea: Please read the FAQ and How to Request Help.
Post Reply