Page 1 of 1

Rename only files above a specific filesize

Posted: 04 May 2013, 10:23
by TehTempstack
Hi there,

I've set up a renaming job on my Synology NAS that is working perfectly fine - so let me first thank you a lot for this great tool.
There is only little thing that is that could be improved though:

From time to time the folders that are checked for files to be renamed do not only contain an episode but also a sample of the episode. So I was wondering if it is possible to perform the renaming and moving operation only on files above a specific file size - or the other way round, exclude files below a specific filesize from being treated.

Thanks in advance for your help!


P.S.: I've found this topic (http://www.filebot.net/forums/viewtopic.php?f=4&t=458) describing a similar scenario but I wasn't able to find a page where the option mentioned there was described (maybe together with a size option!?).

Re: Rename only files above a specific filesize

Posted: 04 May 2013, 11:25
by rednoah
Let's say we have a list of files called input, then you'd filter out small files like this:

Code: Select all

input = input.findAll{ it.length() > 250 * 10**6 } // keep only files bigger than 250 MB
This is the code for a filter you can bake into your groovy script. Or you can do the whole thing with bash and then call filebot only on the bigger files.

EDIT: Added a minfilesize option to amc.groovy

Re: Rename only files above a specific filesize

Posted: 05 May 2013, 10:05
by TehTempstack
Thanks a lot for your help, will give it a try! :)