From 0d569a88bcea5a834a8179862caf3457fc96c67e Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 21 May 2013 17:17:19 +0000 Subject: [PATCH] * try fixing things up for the "thekilling" corner case --- source/net/sourceforge/filebot/WebServices.java | 7 +++---- source/net/sourceforge/filebot/cli/CmdlineOperations.java | 4 ++-- .../net/sourceforge/filebot/similarity/EpisodeMetrics.java | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/source/net/sourceforge/filebot/WebServices.java b/source/net/sourceforge/filebot/WebServices.java index 2b399385..073524cd 100644 --- a/source/net/sourceforge/filebot/WebServices.java +++ b/source/net/sourceforge/filebot/WebServices.java @@ -157,10 +157,9 @@ public final class WebServices { public SeriesInfo getSeriesInfoByLocalIndex(String name, Locale locale) throws Exception { - for (SearchResult it : getLocalIndex().search(name)) { - if (name.equals(it.getName())) { - return getSeriesInfo((TheTVDBSearchResult) it, locale); - } + List results = getLocalIndex().search(name); + if (results.size() > 0) { + return getSeriesInfo((TheTVDBSearchResult) results.get(0), locale); } return null; } diff --git a/source/net/sourceforge/filebot/cli/CmdlineOperations.java b/source/net/sourceforge/filebot/cli/CmdlineOperations.java index fc580072..a53d761e 100644 --- a/source/net/sourceforge/filebot/cli/CmdlineOperations.java +++ b/source/net/sourceforge/filebot/cli/CmdlineOperations.java @@ -858,10 +858,10 @@ public class CmdlineOperations implements CmdlineInterface { // use name similarity metric final SimilarityMetric metric = new NameSimilarityMetric(); - // find probable matches using name similarity > 0.85 (or > 0.75 in non-strict mode) + // find probable matches using name similarity > 0.8 (or > 0.6 in non-strict mode) for (SearchResult result : searchResults) { float f = (query == null) ? 1 : metric.getSimilarity(query, result.getName()); - if (f >= (strict && searchResults.size() > 1 ? 0.85 : 0.75) || ((f >= 0.5 || !strict) && result.getName().toLowerCase().startsWith(query.toLowerCase()))) { + if (f >= (strict && searchResults.size() > 1 ? 0.8 : 0.6) || ((f >= 0.5 || !strict) && (result.getName().toLowerCase().startsWith(query.toLowerCase())))) { if (!probableMatches.contains(result)) { probableMatches.add(result); } diff --git a/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java b/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java index d3d2b3ab..fdc06b4e 100644 --- a/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java +++ b/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java @@ -486,7 +486,7 @@ public enum EpisodeMetrics implements SimilarityMetric { seriesInfoCache.put(n, seriesInfo); } - if (seriesInfo != null && seriesInfo.getRatingCount() >= 10) { + if (seriesInfo != null && seriesInfo.getRatingCount() >= 20) { return max(0, seriesInfo.getRating().floatValue()); } }