Problems with "def ignore"

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
redbull666
Donor
Posts: 58
Joined: 08 Jan 2014, 20:45

Problems with "def ignore"

Post by redbull666 »

I have been struggling with the "def ignore" feature of Filebot. I have a mildly complex requirement, namely I want to use hardlinking for regular MKV files, and copy for subtitles.

The reason is that for releases that include subtitle files, hardlinking can cause a problem. When a repack or proper is released and automatically downloaded (by Sonarr for example), there's a chance it comes without subtitles. This means you will end up with two release folders in your torrent client and download folder, one with hardlinked subtitles, and one with hardlinked MKV. This is messy, and prevents automatic cleanup of no longer hardlinked releases.

My intention is to fix that by running Filebot twice on each download, hardlinking MKV and copying subs.

I have tried several combinations of "def ignore", as there's different examples to be found, none of them are working for me, latest version I am trying is this:

Code: Select all

--def "ignore=[.]nfo|[.]mkv|[.]mp4"
Have also tried:

Code: Select all

--def "ignore=.nfo|.mkv|.mp4"
--def "ignore=nfo|mkv|mp4"
--def ignore="nfo|mkv|mp4"
--def ignore=".nfo|.mkv|.mp4"
--def ignore="*.nfo|*.mkv|*.mp4"
etc...

All fail, Filebot ends up processing the MVK file anyway:

Code: Select all

Parameter: ignore = [.]nfo|[.]mkv|[.]mp4
Input: /mnt/storage/torrents/downloads/MOVIE_ABOUT_UBUNTU_TORRENT.mkv
Group: [:] => [MOVIE_ABOUT_UBUNTU_TORRENT.mkv]
Get [English] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: /mnt/storage/torrents/downloads/MOVIE_ABOUT_UBUNTU_TORRENT.mkv
Processing 1 unsorted files
[COPY] Rename [/mnt/storage/torrents/downloads/MOVIE_ABOUT_UBUNTU_TORRENT.mkv] to [/mnt/storage/media/Unsorted/MOVIE_ABOUT_UBUNTU_TORRENT.mkv]
I have one bonus question, is this intended behaviour when subtitle download is disabled:

Code: Select all

Illegal language code: n
So basically not disabling subtitle download, just providing a non-existing language, and thus downloading no subs, right? Just don't like errors in my output ;)
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problems with "def ignore"

Post by rednoah »

1.
Current ignore behaviour only applies to autodetection.

This log entry means that auto-detection was skipped (or has failed):

Code: Select all

Group: [:] => [file.mkv]
However, you seem to specify --def unsorted=y (THAT IS WHY YOU ALWAYS NEED INCLUDE THE FULL LOGS) which then picks up these ignored files.

Remove --def unsorted=y from your command if you want to completely ignore files.


2.
Bonus questions: Why add --def subtitles when you don't want subtitles? I'd just not specify that argument at all. :P
:idea: Please read the FAQ and How to Request Help.
redbull666
Donor
Posts: 58
Joined: 08 Jan 2014, 20:45

Re: Problems with "def ignore"

Post by redbull666 »

First of all, thank you for your amazingly fast response, as always!
rednoah wrote:1.
Current ignore behaviour only applies to autodetection.

This log entry means that auto-detection was skipped (or has failed):

Code: Select all

Group: [:] => [file.mkv]
However, you seem to specify --def unsorted=y (THAT IS WHY YOU ALWAYS NEED INCLUDE THE FULL LOGS) which then picks up these ignored files.
Ah apologies for not posting the full logs. However, I do not want to disable unsorted=y, I actually want that feature. If Filebot doesn't recognize the download as a Movie or TV-Show, I want the files to end up in "Unsorted".

So if these 2 features cannot be combined, then I I have a problem. Actually while typing this I realize I can keep Unsorted ON for the MVK script, and turn it OFF for the "other" script, which would include SRT and non-Movie, non-TV releases...time to test this.
rednoah wrote: Remove --def unsorted=y from your command if you want to completely ignore files.


2.
Bonus questions: Why add --def subtitles when you don't want subtitles? I'd just not specify that argument at all. :P
Well sir, you told us to:
viewtopic.php?t=2903

I shall remove that part then !
Last edited by redbull666 on 29 Oct 2016, 13:14, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problems with "def ignore"

Post by rednoah »

FYI: if you want the amc script to only process specific files you could pass in those files specifically via many arguments instead of just passing the folder.

On Linux that's easy. On Windows you might need to look into PowerShell.


EDIT:


e.g. call filebot -mediainfo on *.mkv files only:

Code: Select all

find . -iname "*.mkv" -exec filebot -mediainfo {} +
@see http://unix.stackexchange.com/questions ... -find-exec
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problems with "def ignore"

Post by rednoah »

redbull666 wrote:Well sir, you told us to:
viewtopic.php?t=2903
What topic? :P My bad... plenty of outdated information that hasn't been deleted yet...
:idea: Please read the FAQ and How to Request Help.
redbull666
Donor
Posts: 58
Joined: 08 Jan 2014, 20:45

Re: Problems with "def ignore"

Post by redbull666 »

rednoah wrote:FYI: if you want the amc script to only process specific files you could pass in those files specifically via many arguments instead of just passing the folder.

On Linux that's easy. On Windows you might need to look into PowerShell.


EDIT:
Well not really an option for my purpose, I am calling Filebot in an rTorrent post-processing script.
redbull666
Donor
Posts: 58
Joined: 08 Jan 2014, 20:45

Re: Problems with "def ignore"

Post by redbull666 »

rednoah wrote:
redbull666 wrote:Well sir, you told us to:
viewtopic.php?t=2903
What topic? :P My bad... plenty of outdated information that hasn't been deleted yet...
Haha, yes, ideally the information would be in a wiki and only linked to, the forums are a treasure trove of (mostly) great information :)
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problems with "def ignore"

Post by rednoah »

How so? You're calling a shell script and that shell script can do whatever it wants.

If it can call filebot then it most certainly can call find as well. ;)
:idea: Please read the FAQ and How to Request Help.
redbull666
Donor
Posts: 58
Joined: 08 Jan 2014, 20:45

Re: Problems with "def ignore"

Post by redbull666 »

rednoah wrote:How so? You're calling a shell script and that shell script can do whatever it wants.

If it can call filebot then it most certainly can call find as well. ;)
Yea you're right, but it took me quite some time to get the whole setup working smoothly, don't want to diverge too far.

And I think the changes I mentioned above now have the result I am looking for, just need to do some more testing.
Post Reply