diff --git a/source/net/sourceforge/filebot/cli/CmdlineOperations.java b/source/net/sourceforge/filebot/cli/CmdlineOperations.java index 7b949bbc..e4021de6 100644 --- a/source/net/sourceforge/filebot/cli/CmdlineOperations.java +++ b/source/net/sourceforge/filebot/cli/CmdlineOperations.java @@ -270,9 +270,14 @@ public class CmdlineOperations implements CmdlineInterface { if (movieFiles.length > 0 && query == null) { // match movie hashes online - CLILogger.fine(format("Looking up movie by filehash via [%s]", service.getName())); - movieByFileHash = service.getMovieDescriptors(movieFiles, locale); - Analytics.trackEvent(service.getName(), "HashLookup", "Movie", movieByFileHash.length - frequency(asList(movieByFileHash), null)); // number of positive hash lookups + try { + CLILogger.fine(format("Looking up movie by filehash via [%s]", service.getName())); + movieByFileHash = service.getMovieDescriptors(movieFiles, locale); + Analytics.trackEvent(service.getName(), "HashLookup", "Movie", movieByFileHash.length - frequency(asList(movieByFileHash), null)); // number of positive hash lookups + } catch (UnsupportedOperationException e) { + CLILogger.fine(format("%s: Hash lookup not supported", service.getName())); + movieByFileHash = new Movie[movieFiles.length]; + } } if (subtitleFiles.length > 0 && movieFiles.length == 0) { diff --git a/source/net/sourceforge/filebot/ui/rename/MovieHashMatcher.java b/source/net/sourceforge/filebot/ui/rename/MovieHashMatcher.java index 65a7b2a1..d0dee818 100644 --- a/source/net/sourceforge/filebot/ui/rename/MovieHashMatcher.java +++ b/source/net/sourceforge/filebot/ui/rename/MovieHashMatcher.java @@ -65,8 +65,12 @@ class MovieHashMatcher implements AutoCompleteMatcher { if (movieFiles.length > 0) { // match movie hashes online - movieByFileHash = service.getMovieDescriptors(movieFiles, locale); - Analytics.trackEvent(service.getName(), "HashLookup", "Movie", movieByFileHash.length - frequency(asList(movieByFileHash), null)); // number of positive hash lookups + try { + movieByFileHash = service.getMovieDescriptors(movieFiles, locale); + Analytics.trackEvent(service.getName(), "HashLookup", "Movie", movieByFileHash.length - frequency(asList(movieByFileHash), null)); // number of positive hash lookups + } catch (UnsupportedOperationException e) { + movieByFileHash = new Movie[movieFiles.length]; + } } else if (subtitleFiles.length > 0) { // special handling if there is only subtitle files movieByFileHash = new Movie[subtitleFiles.length]; diff --git a/source/net/sourceforge/filebot/web/IMDbClient.java b/source/net/sourceforge/filebot/web/IMDbClient.java index 115967db..d3bd78ea 100644 --- a/source/net/sourceforge/filebot/web/IMDbClient.java +++ b/source/net/sourceforge/filebot/web/IMDbClient.java @@ -203,7 +203,7 @@ public class IMDbClient extends AbstractEpisodeListProvider implements MovieIden @Override public Movie[] getMovieDescriptors(File[] movieFiles, Locale locale) throws Exception { - return new Movie[movieFiles.length]; // UNSUPPORTED OPERATION => EMPTY RESULT + throw new UnsupportedOperationException(); } } diff --git a/source/net/sourceforge/filebot/web/TMDbClient.java b/source/net/sourceforge/filebot/web/TMDbClient.java index bdb85613..37c02da8 100644 --- a/source/net/sourceforge/filebot/web/TMDbClient.java +++ b/source/net/sourceforge/filebot/web/TMDbClient.java @@ -69,8 +69,7 @@ public class TMDbClient implements MovieIdentificationService { public List searchMovie(File file, Locale locale) throws IOException, SAXException { - return emptyList(); // API BROKEN - // return searchMovie(OpenSubtitlesHasher.computeHash(file), file.length(), locale); + throw new UnsupportedOperationException(); }