From fd3771b4b652ccbc69e31d9b8300122232569e5a Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 11 Jan 2014 09:04:49 +0000 Subject: [PATCH] * fine-tune media index --- BuildData.groovy | 7 +++++-- source/net/sourceforge/filebot/media/ReleaseInfo.java | 2 +- website/data/query-blacklist.txt | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/BuildData.groovy b/BuildData.groovy index 469e5796..3c041187 100644 --- a/BuildData.groovy +++ b/BuildData.groovy @@ -70,14 +70,17 @@ def getNamePermutations(names) { def fn2 = { s -> s.replaceAll(/\s&\s/, ' and ') } def fn3 = { s -> s.replaceAll(/\([^\)]*\)$/, '') } - def out = new LinkedHashSet(names*.trim()) + def out = new LinkedHashSet(names*.trim()).toList() def res = out [fn1, fn2, fn3].each{ fn -> res = res.findResults{ fn(it) } } out += res + out = out.findAll{ it.length() >= 2 && !(it =~ /^[a-z]/) && it =~ /^[.\p{L}\p{Digit}]/ } // MUST START WITH UNICODE LETTER - out = out.unique{ it.toLowerCase().normalizePunctuation() }.findAll{ it.length() > 0 }.toList() + out = out.findAll{ !MediaDetection.releaseInfo.structureRootPattern.matcher(it).matches() } // IGNORE NAMES THAT OVERLAP WITH MEDIA FOLDER NAMES + + out = out.unique{ it.toLowerCase().normalizePunctuation() }.findAll{ it.length() > 0 } out = out.size() <= 4 ? out : out.subList(0, 4) return out } diff --git a/source/net/sourceforge/filebot/media/ReleaseInfo.java b/source/net/sourceforge/filebot/media/ReleaseInfo.java index fefc5bc1..7a31ff68 100644 --- a/source/net/sourceforge/filebot/media/ReleaseInfo.java +++ b/source/net/sourceforge/filebot/media/ReleaseInfo.java @@ -209,7 +209,7 @@ public class ReleaseInfo { if (structureRootFolderPattern == null) { List folders = new ArrayList(); for (String it : queryBlacklistResource.get()) { - if (it.startsWith("^")) { + if (it.startsWith("^") && it.endsWith("$")) { folders.add(it); } } diff --git a/website/data/query-blacklist.txt b/website/data/query-blacklist.txt index 467df28b..fb11ad53 100644 --- a/website/data/query-blacklist.txt +++ b/website/data/query-blacklist.txt @@ -15,10 +15,9 @@ \d{2,4}.\b\d{2}.\b\d{2}.\b\d{2}.\b\d{2} \d{3,4}[pi] ^(amc|cover|dvd) -^(TV.)?(Show|Serie)[s]? ^[0-9]{1,2}[.] -^[A-Z0-9]{1,2}$ ^[lp] +^\w{1,2}$ ^Action$ ^Adventure$ ^and$ @@ -118,6 +117,9 @@ ^transfer$ ^transmission$ ^TV$ +^TV.Series$ +^TV.Show$ +^TV.Shows$ ^unsorted$ ^user$ ^utorrent$