2011-12-27 13:54:25 -05:00
|
|
|
// filebot -script "http://filebot.sf.net/scripts/cleaner.groovy" -trust-script /path/to/media/
|
2011-12-20 08:00:38 -05:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Delete orphaned "clutter" files like nfo, jpg, etc
|
|
|
|
*/
|
|
|
|
def isClutter(file) {
|
|
|
|
return file.hasExtension("nfo", "txt", "jpg", "jpeg")
|
|
|
|
}
|
|
|
|
|
|
|
|
// delete clutter files in orphaned media folders
|
|
|
|
args.getFiles{ isClutter(it) && !it.dir.hasFile{ it.isVideo() }}.each {
|
|
|
|
println "Delete file $it: " + it.delete()
|
|
|
|
}
|
|
|
|
|
|
|
|
// delete empty folders but exclude roots
|
|
|
|
args.getFolders{ it.getFiles().isEmpty() && !args.contains(it) }.each {
|
|
|
|
println "Delete dir $it: " + it.deleteDir()
|
|
|
|
}
|