* fine-tune

This commit is contained in:
Reinhard Pointner 2014-01-26 15:04:28 +00:00
parent 6996914492
commit 92193a153d
2 changed files with 8 additions and 4 deletions

View File

@ -60,6 +60,10 @@ public final class SubtitleUtilities {
for (List<File> byMediaFolder : mapByMediaFolder(fileSet).values()) {
for (Entry<String, List<File>> bySeries : mapBySeriesName(byMediaFolder, true, false, Locale.ENGLISH).entrySet()) {
// allow early abort
if (Thread.interrupted())
throw new InterruptedException();
// auto-detect query and search for subtitles
Collection<String> querySet = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
List<File> files = bySeries.getValue();
@ -90,10 +94,9 @@ public final class SubtitleUtilities {
Set<SubtitleDescriptor> subtitles = findSubtitles(service, querySet, languageName);
// dialog may have been cancelled by now
if (Thread.interrupted()) {
// allow early abort
if (Thread.interrupted())
throw new InterruptedException();
}
// files by possible subtitles matches
for (File file : files) {
@ -105,7 +108,7 @@ public final class SubtitleUtilities {
float minMatchSimilarity = strict ? 0.9f : 0.6f;
// first match everything as best as possible, then filter possibly bad matches
for (Entry<File, SubtitleDescriptor> it : matchSubtitles(files, subtitles, strict).entrySet()) {
for (Entry<File, SubtitleDescriptor> it : matchSubtitles(files, subtitles, false).entrySet()) {
if (sanity.getSimilarity(it.getKey(), it.getValue()) >= minMatchSimilarity) {
subtitlesByFile.get(it.getKey()).add(it.getValue());
}

View File

@ -230,6 +230,7 @@ AVCDVD
AVCHD
AVENUE
AVF
AVG
AVS1080
AVS720
AW