delete unnecessary files

Any questions? Need some help?
Post Reply
terra17
Posts: 47
Joined: 06 Sep 2014, 11:10

delete unnecessary files

Post 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 !!!
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: delete unnecessary files

Post by rednoah »

The cleaner script.
:idea: Please read the FAQ and How to Request Help.
terra17
Posts: 47
Joined: 06 Sep 2014, 11:10

Re: delete unnecessary files

Post by terra17 »

Thank you, I didn't see that forum page, sorry.

Let's see what i can do :)
terra17
Posts: 47
Joined: 06 Sep 2014, 11:10

Re: delete unnecessary files

Post 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 ?
terra17
Posts: 47
Joined: 06 Sep 2014, 11:10

Re: delete unnecessary files

Post 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 ?
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: delete unnecessary files

Post 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
:idea: Please read the FAQ and How to Request Help.
terra17
Posts: 47
Joined: 06 Sep 2014, 11:10

Re: delete unnecessary files

Post by terra17 »

so, i have to modify the *.*groovy ?
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: delete unnecessary files

Post 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.
:idea: Please read the FAQ and How to Request Help.
terra17
Posts: 47
Joined: 06 Sep 2014, 11:10

Re: delete unnecessary files

Post 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
Post Reply