* take alias titles into account when checking for subtitle matches

This commit is contained in:
Reinhard Pointner 2015-11-04 04:47:03 +00:00
parent 66d0d401cf
commit 6238500d29
1 changed files with 5 additions and 2 deletions

View File

@ -222,8 +222,11 @@ public final class SubtitleUtilities {
// find probable matches using name similarity > threshold
for (SubtitleSearchResult result : searchResults) {
if (probableMatches.size() <= limit) {
if (metric.getSimilarity(query, removeTrailingBrackets(result.getName())) > 0.8f || result.getName().toLowerCase().startsWith(query.toLowerCase())) {
probableMatches.add(result);
for (String name : result.getEffectiveNames()) {
if (metric.getSimilarity(query, removeTrailingBrackets(name)) > 0.8f || name.toLowerCase().startsWith(query.toLowerCase())) {
probableMatches.add(result);
break;
}
}
}
}