Page 1 of 1

delete unnecessary files

Posted: 24 Sep 2014, 17:25
by terra17
Hi everybody, I'm Alberto

i've got a DS213J nas and i'm making experiments with filebot to organize video files.

i've made this working script

filebot -rename '/volume2/SerieTV/The Blacklist' -r --lang it --db thetvdb --q "The Blacklist" --output '/volume2/SerieTV/The Blacklist' --conflict override --format "{n.upperInitial()} - {sxe} - {t.upperInitial().replacePart(', Parte $1')} - {source}.{vf}.{ac}" -non-strict


My question is: how can i do to remove all the stuff (.txt ; .jpg ; empty folders; etc. etc.) except the renamed file ??

Thank you so much !!!

Re: delete unnecessary files

Posted: 24 Sep 2014, 17:39
by rednoah
The cleaner script.

Re: delete unnecessary files

Posted: 24 Sep 2014, 17:44
by terra17
Thank you, I didn't see that forum page, sorry.

Let's see what i can do :)

Re: delete unnecessary files

Posted: 24 Sep 2014, 18:04
by terra17
i try this in putty.exe

filebot -script "volume1/scripts/cleaner.groovy" /volume2/SerieTV/The\ Blacklist/

FileNotFoundException: volume1/scripts/cleaner.groovy
java.io.FileNotFoundException: volume1/scripts/cleaner.groovy
at net.filebot.cli.ArgumentProcessor$DefaultScriptProvider.getScriptLocation(ArgumentProcessor.java:170)
at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:91)
at net.filebot.Main.main(Main.java:191)
Failure (°_°)

where did i do wrong ?

Re: delete unnecessary files

Posted: 26 Sep 2014, 07:13
by terra17
I understand my problem and I correct

filebot -script '/volume1/scripts/cleaner.groovy' --def 'exts=jpg|nfo|srv|srr|nzb|sfv|idx|sub|txt|part01|part02|par1|par2' '/volume2/SerieTV/The Blacklist/'

why the script delete all the unnecessary folders (:D) but not the single files with those extensions ?

Re: delete unnecessary files

Posted: 26 Sep 2014, 07:32
by rednoah
Won't touch any file in folders where there is at least one video file.
@see https://github.com/filebot/scripts/blob ... ner.groovy

Re: delete unnecessary files

Posted: 26 Sep 2014, 07:48
by terra17
so, i have to modify the *.*groovy ?

Re: delete unnecessary files

Posted: 26 Sep 2014, 08:03
by rednoah
No, but if you wanna know what is considered as isClutter you might wanna have a look at the isClutter function.

You asked:

Code: Select all

My question is: how can i do to remove all the stuff (.txt ; .jpg ; empty folders; etc. etc.) except the renamed file ??
This is my answer:

A: Why do files not get deleted?
The cleaner won't touch any file in folders where there is at least one video file. So that's probably why the files you want don't get deleted. There's a non-clutter video file in the same folder. Consequently you're expected to MOVE files into a new clean folder structure, not just rename in place, and the cleaner will take care of the remainder.

B: Why do files get deleted?
Because the cleaner script doesn't just delete files with certain extensions. And there is multiple other factors that may case a file to be deleted or not, and that's exactly defined in the isClutter() function.

Re: delete unnecessary files

Posted: 26 Sep 2014, 08:11
by terra17
Sorry man, I'm Italian and programming is not my work, I'm trying to understand by myself, in this "pretty English world". Thank you for your answer, the function is 100 % smart, I understand it with experiments while you probably were answering me. I ask you one last thing, then I will stop to be boring

can i make 2 instructions in a single .sh file ?

ex.

filebot -rename .... ... ... ...
filebot -script "groovy" ... ... ...

thank u for your patience