Presume that OpenSubtitles hash matches are being polluted by BSPlayer and never just trust hash matches
@see https://www.filebot.net/forums/viewtopic.php?f=6&t=3452#p19190
This commit is contained in:
parent
9613049cb1
commit
55491a137d
|
@ -875,11 +875,6 @@ public class CmdlineOperations implements CmdlineInterface {
|
||||||
// guess best hash match (default order is open bad due to invalid hash links)
|
// guess best hash match (default order is open bad due to invalid hash links)
|
||||||
SubtitleDescriptor bestMatch = getBestMatch(it.getKey(), it.getValue(), strict);
|
SubtitleDescriptor bestMatch = getBestMatch(it.getKey(), it.getValue(), strict);
|
||||||
|
|
||||||
// if we can't guess the best one, just pick the first one, since all hash matches should good (ideally)
|
|
||||||
if (bestMatch == null && !strict && it.getValue().size() > 0) {
|
|
||||||
bestMatch = it.getValue().get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bestMatch != null) {
|
if (bestMatch != null) {
|
||||||
CLILogger.finest(format("Matched [%s] to [%s] via hash", it.getKey().getName(), bestMatch.getName()));
|
CLILogger.finest(format("Matched [%s] to [%s] via hash", it.getKey().getName(), bestMatch.getName()));
|
||||||
subtitleByVideo.put(it.getKey(), bestMatch);
|
subtitleByVideo.put(it.getKey(), bestMatch);
|
||||||
|
|
|
@ -159,8 +159,9 @@ public final class SubtitleUtilities {
|
||||||
}
|
}
|
||||||
|
|
||||||
// allow early abort
|
// allow early abort
|
||||||
if (Thread.interrupted())
|
if (Thread.interrupted()) {
|
||||||
throw new InterruptedException();
|
throw new InterruptedException();
|
||||||
|
}
|
||||||
|
|
||||||
// files by possible subtitles matches
|
// files by possible subtitles matches
|
||||||
for (File file : files) {
|
for (File file : files) {
|
||||||
|
|
|
@ -214,12 +214,13 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS
|
||||||
List<Query> hashQueryList = new ArrayList<Query>(files.length);
|
List<Query> hashQueryList = new ArrayList<Query>(files.length);
|
||||||
|
|
||||||
for (File file : files) {
|
for (File file : files) {
|
||||||
// add hash query
|
Query query = file.length() > HASH_CHUNK_SIZE ? Query.forHash(computeHash(file), file.length(), languageFilter) : null;
|
||||||
if (file.length() > HASH_CHUNK_SIZE) {
|
|
||||||
String movieHash = computeHash(file);
|
|
||||||
Query query = Query.forHash(movieHash, file.length(), languageFilter);
|
|
||||||
|
|
||||||
// check hash
|
// DEBUG
|
||||||
|
// query = Query.forHash("b4a91d8384a92269", 1178926184, languageFilter);
|
||||||
|
|
||||||
|
// add hash query
|
||||||
|
if (query != null) {
|
||||||
List<SubtitleDescriptor> cachedResults = getCache().getSubtitleDescriptorList(query);
|
List<SubtitleDescriptor> cachedResults = getCache().getSubtitleDescriptorList(query);
|
||||||
if (cachedResults == null) {
|
if (cachedResults == null) {
|
||||||
hashQueryList.add(query);
|
hashQueryList.add(query);
|
||||||
|
|
Loading…
Reference in New Issue