* fix subtitles-not-found issue caused by the limit of 500. The limit should now be 2000 and effectively not ever be an issue again
This commit is contained in:
parent
5fadfbe3e3
commit
2ad88bd306
|
@ -108,7 +108,7 @@ public class OpenSubtitlesSubtitleDescriptor implements SubtitleDescriptor, Seri
|
|||
try {
|
||||
stream = new GZIPInputStream(stream);
|
||||
} catch (ZipException e) {
|
||||
throw new IOException(String.format("%s: anti-leech limit may have been reached", e.getMessage()));
|
||||
throw new IOException(String.format("%s: anti-leech limit has been reached", e.getMessage()));
|
||||
}
|
||||
|
||||
// fully download
|
||||
|
|
|
@ -96,7 +96,7 @@ public class OpenSubtitlesXmlRpc {
|
|||
@SuppressWarnings("unchecked")
|
||||
public List<OpenSubtitlesSubtitleDescriptor> searchSubtitles(Collection<Query> queryList) throws XmlRpcFault {
|
||||
List<OpenSubtitlesSubtitleDescriptor> subtitles = new ArrayList<OpenSubtitlesSubtitleDescriptor>();
|
||||
Map<?, ?> response = invoke("SearchSubtitles", token, queryList);
|
||||
Map<?, ?> response = invoke("SearchSubtitles", token, queryList, singletonMap("limit", 2000));
|
||||
|
||||
try {
|
||||
List<Map<String, String>> subtitleData = (List<Map<String, String>>) response.get("data");
|
||||
|
|
|
@ -177,6 +177,15 @@ public class OpenSubtitlesXmlRpcTest {
|
|||
assertEquals(48717, data.remaining(), 0);
|
||||
}
|
||||
|
||||
// @Test(expected = IOException.class)
|
||||
public void fetchSubtitlesExceedLimit() throws Exception {
|
||||
List<OpenSubtitlesSubtitleDescriptor> list = xmlrpc.searchSubtitles(773262, "eng");
|
||||
|
||||
for (int i = 0; true; i++) {
|
||||
System.out.format("Fetch #%d: %s%n", i, list.get(i).fetch());
|
||||
}
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void logout() throws Exception {
|
||||
// logout manually
|
||||
|
|
Loading…
Reference in New Issue