* don't delete sample files larger than 100 MB to make sure no real movies files get deleted by mistake

This commit is contained in:
Reinhard Pointner 2012-07-13 11:55:34 +00:00
parent d29fe49390
commit 8fc53733dd
1 changed files with 3 additions and 1 deletions

View File

@ -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
}