From 9e7f3618d2a5e95fed8e5366fc7387d8c4fab014 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 13 Jul 2012 06:52:20 +0000 Subject: [PATCH] * make matchMovieName CWS maxStartIndex customizable --- source/net/sourceforge/filebot/ApplicationStarter.java | 4 ++-- source/net/sourceforge/filebot/media/MediaDetection.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/net/sourceforge/filebot/ApplicationStarter.java b/source/net/sourceforge/filebot/ApplicationStarter.java index b047fad4..2cdc466e 100644 --- a/source/net/sourceforge/filebot/ApplicationStarter.java +++ b/source/net/sourceforge/filebot/ApplicationStarter.java @@ -262,8 +262,8 @@ public class ApplicationStarter { // pre-load movie/series index List dummy = Collections.singletonList(""); MediaDetection.stripReleaseInfo(dummy, true); - MediaDetection.matchSeriesByName(dummy, 0); - MediaDetection.matchMovieName(dummy, true); + MediaDetection.matchSeriesByName(dummy, -1); + MediaDetection.matchMovieName(dummy, true, -1); // pre-load Groovy script engine new ExpressionFormat("").format(""); diff --git a/source/net/sourceforge/filebot/media/MediaDetection.java b/source/net/sourceforge/filebot/media/MediaDetection.java index 60dccfe6..67c034b7 100644 --- a/source/net/sourceforge/filebot/media/MediaDetection.java +++ b/source/net/sourceforge/filebot/media/MediaDetection.java @@ -320,7 +320,7 @@ public class MediaDetection { terms.add(reduceMovieName(getName(movieFolder))); } - List movieNameMatches = matchMovieName(terms, strict); + List movieNameMatches = matchMovieName(terms, strict, 3); // skip further queries if collected matches are already sufficient if (options.size() > 0 && movieNameMatches.size() > 0) { @@ -330,7 +330,7 @@ public class MediaDetection { // if matching name+year failed, try matching only by name if (movieNameMatches.isEmpty() && strict) { - movieNameMatches = matchMovieName(terms, false); + movieNameMatches = matchMovieName(terms, false, 3); } // assume name without spacing will mess up any lookup @@ -411,9 +411,9 @@ public class MediaDetection { } - public static List matchMovieName(final List files, final boolean strict) throws Exception { + public static List matchMovieName(final List files, boolean strict, int maxStartIndex) throws Exception { // cross-reference file / folder name with movie list - final HighPerformanceMatcher nameMatcher = new HighPerformanceMatcher(3); + final HighPerformanceMatcher nameMatcher = new HighPerformanceMatcher(maxStartIndex); final Map matchMap = new HashMap(); for (Entry movie : getMovieIndex()) {