* since we're using pristine movie objects now we don't need to care about high numbers of alias titles in the local index, and for tvs/anime it does not matter anyway since the alias title number is capped
This commit is contained in:
parent
d228f6d758
commit
f5c02ed976
|
@ -64,7 +64,7 @@ def isValidMovieName(s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
def getNamePermutations(names) {
|
def getNamePermutations(names) {
|
||||||
def normalize = { s -> s.toLowerCase().normalizePunctuation() }.memoize()
|
def normalize = { s -> s.toLowerCase().normalizePunctuation() }
|
||||||
def fn1 = { s -> s.replaceAll(/(?i)(^(The|A)\s)|([,]\s(The|A)$)/, '') }
|
def fn1 = { s -> s.replaceAll(/(?i)(^(The|A)\s)|([,]\s(The|A)$)/, '') }
|
||||||
def fn2 = { s -> s.replaceAll(/\s&\s/, ' and ') }
|
def fn2 = { s -> s.replaceAll(/\s&\s/, ' and ') }
|
||||||
def fn3 = { s -> s.replaceAll(/\([^\)]*\)$/, '') }
|
def fn3 = { s -> s.replaceAll(/\([^\)]*\)$/, '') }
|
||||||
|
@ -77,7 +77,6 @@ def getNamePermutations(names) {
|
||||||
|
|
||||||
out = out.findAll{ it.length() >= 2 && !(it ==~ /[1][0-9][1-9]/) && !(it =~ /^[a-z]/) && it =~ /^[@.\p{L}\p{Digit}]/ } // MUST START WITH UNICODE LETTER
|
out = out.findAll{ it.length() >= 2 && !(it ==~ /[1][0-9][1-9]/) && !(it =~ /^[a-z]/) && it =~ /^[@.\p{L}\p{Digit}]/ } // MUST START WITH UNICODE LETTER
|
||||||
out = out.findAll{ !MediaDetection.releaseInfo.structureRootPattern.matcher(it).matches() } // IGNORE NAMES THAT OVERLAP WITH MEDIA FOLDER NAMES
|
out = out.findAll{ !MediaDetection.releaseInfo.structureRootPattern.matcher(it).matches() } // IGNORE NAMES THAT OVERLAP WITH MEDIA FOLDER NAMES
|
||||||
out = out.findAll{ a -> names.take(1).contains(a) || out.findAll{ b -> normalize(a).startsWith(normalize(b) + ' ') }.size() == 0 } // TRY TO EXCLUDE REDUNDANT SUBSTRING DUPLICATES
|
|
||||||
|
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue