From 8fc53733dd006fc24560a5ec3721898b9ac38577 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 13 Jul 2012 11:55:34 +0000 Subject: [PATCH] * don't delete sample files larger than 100 MB to make sure no real movies files get deleted by mistake --- website/scripts/cleaner.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/scripts/cleaner.groovy b/website/scripts/cleaner.groovy index 293a1b13..f05c12bf 100644 --- a/website/scripts/cleaner.groovy +++ b/website/scripts/cleaner.groovy @@ -4,7 +4,9 @@ * Delete orphaned "clutter" files like nfo, jpg, etc and sample files */ def isClutter(f) { - f.path =~ /\b(?i:sample|trailer|extras|deleted.scenes|music.video|scrapbook)\b/ || f.hasExtension("jpg", "jpeg", "png", "gif", "nfo", "xml", "htm", "html", "log", "srt", "sub", "idx", "md5", "sfv", "txt", "rtf", "url", "db", "dna") + def blacklist = f.path =~ /\b(?i:sample|trailer|extras|deleted.scenes|music.video|scrapbook)\b/ && f.length() < 100 * 1024 * 1024 + def extension = f.hasExtension("jpg", "jpeg", "png", "gif", "nfo", "xml", "htm", "html", "log", "srt", "sub", "idx", "md5", "sfv", "txt", "rtf", "url", "db", "dna") + return blacklist || extension // path contains blacklisted terms or extension is blacklisted }