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