* QueryNumber may be removed from hash search response, but since we only send 1 query per 1 request we can just take the first one

This commit is contained in:
Reinhard Pointner 2014-05-18 15:47:20 +00:00
parent b833f0e759
commit 383a6922a5
1 changed files with 3 additions and 3 deletions

View File

@ -157,7 +157,7 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS
return results;
}
// max numbers of queries to submit in a single XML-RPC request
// max numbers of queries to submit in a single XML-RPC request, but currently only batchSize == 1 is supported
private final int batchSize = 1;
public Map<File, List<SubtitleDescriptor>> getSubtitleListByHash(File[] files, String languageName) throws Exception {
@ -204,7 +204,7 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS
// submit query and map results to given files
for (OpenSubtitlesSubtitleDescriptor subtitle : xmlrpc.searchSubtitles(batch)) {
// get file for hash
File file = hashMap.get((batch.get(subtitle.getQueryNumber())));
File file = hashMap.get((batch.get(0)));
// add subtitle
if (file != null) {
@ -265,7 +265,7 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS
// submit query and map results to given files
for (OpenSubtitlesSubtitleDescriptor subtitle : xmlrpc.searchSubtitles(batch)) {
// get file for tag
File file = tagMap.get(batch.get(subtitle.getQueryNumber()));
File file = tagMap.get(batch.get(0));
// add subtitle
if (file != null) {