From f602e19fa73485bd4e90ce4fa3f42748f89efd30 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 1 Sep 2013 16:33:36 +0000 Subject: [PATCH] * support for passing in white list pattern in cleaner script @see http://www.filebot.net/forums/viewtopic.php?f=6&t=762#p5731 --- website/scripts/cleaner.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/scripts/cleaner.groovy b/website/scripts/cleaner.groovy index beb4af88..37c6b122 100644 --- a/website/scripts/cleaner.groovy +++ b/website/scripts/cleaner.groovy @@ -5,6 +5,11 @@ def deleteRootFolder = tryQuietly{ root.toBoolean() } * Delete orphaned "clutter" files like nfo, jpg, etc and sample files */ def isClutter(f) { + // white list + def ignore = tryQuietly{ ignore } ?: /extrathumbs/ + if (f.path =~ "(?i)\\b($ignore)\\b") return false + + // black list def exts = tryQuietly{ exts } ?: /jpg|jpeg|png|gif|nfo|xml|htm|html|log|srt|sub|idx|md5|sfv|txt|rtf|url|db|dna|log/ def terms = tryQuietly{ terms } ?: /sample|trailer|extras|deleted.scenes|music.video|scrapbook/ def maxsize = tryQuietly{ maxsize as Long } ?: 100 * 1024 * 1024