1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 16:28:51 -05:00

Make sure to eliminate duplicate queries

This commit is contained in:
Reinhard Pointner 2016-04-09 20:58:32 +00:00
parent e8652a5593
commit 5fc3a90159

View File

@ -934,11 +934,13 @@ public class MediaDetection {
addUniqueQuerySet(exactMatches, normalize, Function.identity(), unique); addUniqueQuerySet(exactMatches, normalize, Function.identity(), unique);
// remove blacklisted terms and remove duplicates // remove blacklisted terms and remove duplicates
List<String> extra = stream(guessMatches).flatMap(Collection::stream).filter(t -> {
return !unique.containsKey(normalize.apply(t));
}).collect(toList());
Set<String> terms = new LinkedHashSet<String>(); Set<String> terms = new LinkedHashSet<String>();
for (Collection<String> it : guessMatches) { terms.addAll(stripReleaseInfo(extra, true));
terms.addAll(stripReleaseInfo(it, true)); terms.addAll(stripReleaseInfo(extra, false));
terms.addAll(stripReleaseInfo(it, false));
}
addUniqueQuerySet(stripBlacklistedTerms(terms), normalize, normalize, unique); addUniqueQuerySet(stripBlacklistedTerms(terms), normalize, normalize, unique);
return new ArrayList<String>(unique.values()); return new ArrayList<String>(unique.values());