AMC Script vs --apply Post Processing

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
HarryMuscle
Posts: 34
Joined: 06 Jan 2022, 22:40

AMC Script vs --apply Post Processing

Post by HarryMuscle »

Still learning all the features of FileBot and I just found out about being able to script the post processing features using the --apply command. What I'm now trying to figure out is if this basically makes the majority of the AMC script functionality redundant. I see that the AMC script can uncompress files as well as notify the media server of changes, but everything thing else seems like it overlaps with the --apply command. The only thing I'm not sure about is whether the AMC script provides additional file selection logic that maybe you don't get if you invoke FileBot directly to do the renaming (ie: AMC can handle renaming movies and TV shows all in the same input folder, not sure how FileBot would react to something like that). Or am I missing something in my understanding? Is it possible to invoke FileBot directly to do the renaming, nfo generating, artwork downloading, subtitle fetching, etc. instead of using the AMC script ... especially if one wants finer control over everything?

Thanks,
Harry
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script vs --apply Post Processing

Post by rednoah »

Yes. There are a number of features that were introduced in the amc script and later built into the FileBot application as standard features that can be used in both GUI and CLI.


You can indeed use filebot -rename to perform typical tasks:

Code: Select all

$ filebot -rename Alias.1x01.mp4 -non-strict --apply nfo
Classify media files
Rename episodes using [TheMovieDB] with [Airdate]
[MOVE] from [Alias.1x01.mp4] to [Alias - 1x01 - Truth Be Told.mp4]
[NFO] TheMovieDB::TV::2046 (tvshow.nfo)
Processed 1 file

:!: Note that the --apply post-processing features are explicitly not configurable and give you zero control by design for the sake of simplicity. The amc script on the other hand is really just a few hundred lines of fine-grained configuration and related plumbing, to call -rename in different ways and do things before and after. You'd typically use bash for that, but we use Groovy, because Windows. If you need customization, then you'll want to fork the amc script and its dependencies and make your modifications there, or just make your own call before / after calling filebot.


:?: What kind of finer control over everything are you looking for specifically?
:idea: Please read the FAQ and How to Request Help.
HarryMuscle
Posts: 34
Joined: 06 Jan 2022, 22:40

Re: AMC Script vs --apply Post Processing

Post by HarryMuscle »

rednoah wrote: 03 Feb 2022, 04:33 Yes. There are a number of features that were introduced in the amc script and later built into the FileBot application as standard features that can be used in both GUI and CLI.


You can indeed use filebot -rename to perform typical tasks:

Code: Select all

$ filebot -rename Alias.1x01.mp4 -non-strict --apply nfo
Classify media files
Rename episodes using [TheMovieDB] with [Airdate]
[MOVE] from [Alias.1x01.mp4] to [Alias - 1x01 - Truth Be Told.mp4]
[NFO] TheMovieDB::TV::2046 (tvshow.nfo)
Processed 1 file

:!: Note that the --apply post-processing features are explicitly not configurable and give you zero control by design for the sake of simplicity. The amc script on the other hand is really just a few hundred lines of fine-grained configuration and related plumbing, to call -rename in different ways and do things before and after. You'd typically use bash for that, but we use Groovy, because Windows. If you need customization, then you'll want to fork the amc script and its dependencies and make your modifications there, or just make your own call before / after calling filebot.


:?: What kind of finer control over everything are you looking for specifically?
Currently the primary fine tuning that I'm attempting is to use TMDB for everything including NFO files for TV shows (your answer in one of my other posts related to that effort is what made me aware of the post processing features). That and generating NFO files for each episode but you were able to whip up a script to tackle that (much appreciated). Unfortunately though that means that currently I have to use three separate scripts to rename and generate NFO files for everything ... first the AMC script to rename stuff, then the FileBot built in post processing to download artwork and create NFO files from TMDB, then the nfo.groovy script you created to create NFO files for episodes. Which got me thinking maybe I can cut out the AMC script to reduce the steps involved. This is all getting scripted but the less steps involved the less chance for things to break. On a related note if there's any way in a future releases to reduce these steps (ie: update the htpc library script to work with TMDB, or incorporate episode NFO file generation (possibly making it optional) into the AMC script) that would be much appreciated.

Thanks,
Harry
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Script vs --apply Post Processing

Post by rednoah »

Why not create your own process-media-files.sh script?

Code: Select all

#!/bin/sh -xu
INPUT="$1"

# some custom pre-processing commands

filebot -script fn:amc "$INPUT" ...
filebot -script fn:nfo "$INPUT" ...

# some custom post-processing commands

:!: Depending on the features you need, less amc script just means more custom bash script. :lol: There's many pros and cons to that though. :ugeek:


:idea: You'll want to compose your process of commands that you can understand and test individually one by one. A single complicated command is much harder to understand and test than a series of simple commands that you can test individually one by one in rapid succession. So more steps can be better if that makes the steps simple and easy to understand. ;)
:idea: Please read the FAQ and How to Request Help.
Post Reply