mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-15 22:05:00 -05:00
* catch XML-RPC errors
This commit is contained in:
parent
41cd488bae
commit
66d0d401cf
@ -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()));
|
||||
}
|
||||
|
@ -94,18 +94,21 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS
|
||||
|
||||
@Override
|
||||
public List<SubtitleSearchResult> guess(String tag) throws Exception {
|
||||
List<SubtitleSearchResult> 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<SubtitleSearchResult> 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
|
||||
|
Loading…
Reference in New Issue
Block a user