From 66d0d401cff7f48ea3e0f721b82b866905789c22 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 4 Nov 2015 04:08:57 +0000 Subject: [PATCH] * catch XML-RPC errors --- .../filebot/subtitle/SubtitleUtilities.java | 2 +- .../net/filebot/web/OpenSubtitlesClient.java | 25 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/source/net/filebot/subtitle/SubtitleUtilities.java b/source/net/filebot/subtitle/SubtitleUtilities.java index 1b9afc54..ffefbc8c 100644 --- a/source/net/filebot/subtitle/SubtitleUtilities.java +++ b/source/net/filebot/subtitle/SubtitleUtilities.java @@ -113,7 +113,7 @@ public final class SubtitleUtilities { if (selection.isEmpty()) { for (File f : files) { try { - selection.addAll(service.guess(getName(f))); // !!! XML-RPC METHOD CURRENTLY BROKEN !!! + selection.addAll(service.guess(getName(f))); } catch (Exception e) { Logger.getLogger(SubtitleUtilities.class.getName()).log(Level.WARNING, String.format("Failed to identify file [%s]: %s", f.getName(), e.getMessage())); } diff --git a/source/net/filebot/web/OpenSubtitlesClient.java b/source/net/filebot/web/OpenSubtitlesClient.java index 65c115a6..84fbf5a2 100644 --- a/source/net/filebot/web/OpenSubtitlesClient.java +++ b/source/net/filebot/web/OpenSubtitlesClient.java @@ -94,18 +94,21 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS @Override public List guess(String tag) throws Exception { - List subtitles = getCache().getSearchResult("guess", tag); - if (subtitles != null) { - return subtitles; - } + // !!! XML-RPC CURRENTLY METHOD BROKEN !!! + return emptyList(); - // require login - login(); - - subtitles = xmlrpc.guessMovie(singleton(tag)).getOrDefault(tag, emptyList()); // XML-RPC METHOD BROKEN - - getCache().putSearchResult("guess", tag, subtitles); - return subtitles; + // List subtitles = getCache().getSearchResult("guess", tag); + // if (subtitles != null) { + // return subtitles; + // } + // + // // require login + // login(); + // + // subtitles = xmlrpc.guessMovie(singleton(tag)).getOrDefault(tag, emptyList()); + // + // getCache().putSearchResult("guess", tag, subtitles); + // return subtitles; } @Override