* use OSDB guessMovie feature if our own series/movie detection logic fails
This commit is contained in:
parent
e55526c3ac
commit
39d012745a
|
@ -104,8 +104,16 @@ public final class SubtitleUtilities {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!searchByMovie && !searchBySeries && guessSet.isEmpty())
|
// try OpenSubtitles guess function if we can't make sense of the files
|
||||||
|
if (!searchByMovie && !searchBySeries) {
|
||||||
|
for (File f : files) {
|
||||||
|
guessSet.addAll(service.guess(getName(f)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!searchByMovie && !searchBySeries && guessSet.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// search for subtitles online using the auto-detected or forced query information
|
// search for subtitles online using the auto-detected or forced query information
|
||||||
Set<SubtitleDescriptor> subtitles = findSubtitles(service, guessSet, querySet, searchByMovie, searchBySeries, languageName);
|
Set<SubtitleDescriptor> subtitles = findSubtitles(service, guessSet, querySet, searchByMovie, searchBySeries, languageName);
|
||||||
|
|
|
@ -95,8 +95,6 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS
|
||||||
@Override
|
@Override
|
||||||
public List<SubtitleSearchResult> guess(String tag) throws Exception {
|
public List<SubtitleSearchResult> guess(String tag) throws Exception {
|
||||||
List<SubtitleSearchResult> subtitles = getCache().getSearchResult("guess", tag);
|
List<SubtitleSearchResult> subtitles = getCache().getSearchResult("guess", tag);
|
||||||
System.out.println(tag);
|
|
||||||
System.out.println(subtitles);
|
|
||||||
if (subtitles != null) {
|
if (subtitles != null) {
|
||||||
return subtitles;
|
return subtitles;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue