Skip processing types of files

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Skip processing types of files

Post by devster »

I'm using the KEEPLINK option in filebot, since this allows me to move the file to another disk but keep seeding.
However it might happen that I add again the torrent that would use that symlink to seed, and in this case transmission considers the verification of files as another complete download, thereby firing filebot another time.
How could I prevent filebot from even considering symlinks to be processed?
Unfortunately, according to this link, transmission doesn't pass the list of files as argument but rather the path, which could be a directory (potentially containing symlinks) or a symlink itself.
I'm using fn:amc on linux.
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Skip processing types of files

Post by rednoah »

You could just check if there's any symlinks in the input, and then decide whether to call filebot or not based on that. That's no more than 1-2 extra lines in your postprocess shell script.

@see https://linux.die.net/man/1/find
:idea: Please read the FAQ and How to Request Help.
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Skip processing types of files

Post by devster »

Thanks, that sounds easy enough, didn't think about that.
This seems to work, sharing for posterity (transmission is the client).

Code: Select all

ARG_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
...
LINKS=$(find $ARG_PATH -type l)
if [[ ${#LINKS} -gt 0 ]]
then
    exit 0
fi
As a related question, does filebot -revert also move files back to their original location?
Would I need to call it on the link or on the moved file?
Last edited by devster on 27 Jul 2017, 23:09, edited 1 time in total.
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Skip processing types of files

Post by rednoah »

Yes, -revert will correctly revert files to their original path. You would call it on the destination path.
:idea: Please read the FAQ and How to Request Help.
Post Reply