* fine-tune media index

This commit is contained in:
Reinhard Pointner 2014-01-11 09:04:49 +00:00
parent 91e6fbc5a1
commit fd3771b4b6
3 changed files with 10 additions and 5 deletions

View File

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

View File

@ -209,7 +209,7 @@ public class ReleaseInfo {
if (structureRootFolderPattern == null) {
List<String> folders = new ArrayList<String>();
for (String it : queryBlacklistResource.get()) {
if (it.startsWith("^")) {
if (it.startsWith("^") && it.endsWith("$")) {
folders.add(it);
}
}

View File

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