From 383a6922a5e461881a1efb167e16ae24fa67c988 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 18 May 2014 15:47:20 +0000 Subject: [PATCH] * 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 --- source/net/filebot/web/OpenSubtitlesClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/net/filebot/web/OpenSubtitlesClient.java b/source/net/filebot/web/OpenSubtitlesClient.java index d7292567..b5d0fef3 100644 --- a/source/net/filebot/web/OpenSubtitlesClient.java +++ b/source/net/filebot/web/OpenSubtitlesClient.java @@ -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> 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) {