1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

* slight match auto-selection tweaks

This commit is contained in:
Reinhard Pointner 2012-07-09 12:14:13 +00:00
parent eae1887e83
commit 4b40e02888

View File

@ -755,7 +755,7 @@ public class CmdlineOperations implements CmdlineInterface {
// find probable matches using name similarity > 0.9 (or > 0.8 in non-strict mode) // find probable matches using name similarity > 0.9 (or > 0.8 in non-strict mode)
for (SearchResult result : searchResults) { for (SearchResult result : searchResults) {
float f = (query == null) ? 1 : metric.getSimilarity(query, result.getName()); float f = (query == null) ? 1 : metric.getSimilarity(query, result.getName());
if (f >= (strict ? 0.9 : 0.8) || ((f >= 0.5 || !strict) && result.getName().toLowerCase().startsWith(query.toLowerCase()))) { if (f >= (strict ? 0.85 : 0.75) || ((f >= 0.5 || !strict) && result.getName().toLowerCase().startsWith(query.toLowerCase()))) {
if (!probableMatches.containsKey(result.toString().toLowerCase())) { if (!probableMatches.containsKey(result.toString().toLowerCase())) {
probableMatches.put(result.toString().toLowerCase(), result); probableMatches.put(result.toString().toLowerCase(), result);
} }