* improved subtitle auto-detection

This commit is contained in:
Reinhard Pointner 2013-07-30 17:54:10 +00:00
parent d851e941c9
commit 3f6487b621
2 changed files with 2 additions and 2 deletions

View File

@ -590,7 +590,7 @@ public class MediaDetection {
} }
private static SimilarityMetric getMovieMatchMetric() { public static SimilarityMetric getMovieMatchMetric() {
return new MetricAvg(new SequenceMatchSimilarity(), new NameSimilarityMetric(), new SequenceMatchSimilarity(0, true), new NumericSimilarityMetric() { return new MetricAvg(new SequenceMatchSimilarity(), new NameSimilarityMetric(), new SequenceMatchSimilarity(0, true), new NumericSimilarityMetric() {
private Pattern year = Pattern.compile("\\b\\d{4}\\b"); private Pattern year = Pattern.compile("\\b\\d{4}\\b");

View File

@ -61,7 +61,7 @@ public final class SubtitleUtilities {
return f < 1 ? -1 : 1; return f < 1 ? -1 : 1;
} }
}; };
SimilarityMetric sanity = new MetricCascade(absoluteSeasonEpisode, AirDate, new MetricAvg(NameSubstringSequence, Name)); SimilarityMetric sanity = new MetricCascade(absoluteSeasonEpisode, AirDate, new MetricAvg(NameSubstringSequence, Name), getMovieMatchMetric());
// first match everything as best as possible, then filter possibly bad matches // first match everything as best as possible, then filter possibly bad matches
Matcher<File, SubtitleDescriptor> matcher = new Matcher<File, SubtitleDescriptor>(files, subtitles, false, metrics); Matcher<File, SubtitleDescriptor> matcher = new Matcher<File, SubtitleDescriptor>(files, subtitles, false, metrics);