Remove @Depricated "Movie Search By Hash" interface. OpenSubtitles is not used as a Movie datasource anymore, and TMDb doesn't do hashes anymore.

This commit is contained in:
Reinhard Pointner 2016-03-27 22:35:19 +00:00
parent 5151bd8c7f
commit 963fb62172
7 changed files with 3 additions and 56 deletions

View File

@ -342,18 +342,6 @@ public class CmdlineOperations implements CmdlineInterface {
// match movie hashes online
final Map<File, Movie> movieByFile = new TreeMap<File, Movie>();
if (query == null) {
if (movieFiles.size() > 0) {
try {
Map<File, Movie> hashLookup = service.getMovieDescriptors(movieFiles, locale);
if (hashLookup.size() > 0) {
log.finest(format("Looking up up movie by hash via [%s]", service.getName()));
movieByFile.putAll(hashLookup);
}
} catch (UnsupportedOperationException e) {
// ignore logging => hash lookup only supported by OpenSubtitles
}
}
// collect useful nfo files even if they are not part of the selected fileset
Set<File> effectiveNfoFileSet = new TreeSet<File>(nfoFiles);
for (File dir : mapByFolder(movieFiles).keySet()) {

View File

@ -580,19 +580,6 @@ public class MediaDetection {
options.add((Movie) metaObject);
}
// lookup by file hash
if (service != null && movieFile.isFile()) {
try {
for (Movie movie : service.getMovieDescriptors(singleton(movieFile), locale).values()) {
if (movie != null) {
options.add(movie);
}
}
} catch (UnsupportedOperationException e) {
// ignore logging => hash lookup only supported by OpenSubtitles
}
}
// lookup by id from nfo file
if (service != null) {
for (int imdbid : grepImdbId(movieFile.getPath())) {

View File

@ -94,15 +94,7 @@ class MovieHashMatcher implements AutoCompleteMatcher {
}
// match movie hashes online
final Map<File, Movie> movieByFile = new TreeMap<File, Movie>();
if (autodetect && movieFiles.size() > 0) {
try {
Map<File, Movie> hashLookup = service.getMovieDescriptors(movieFiles, locale);
movieByFile.putAll(hashLookup);
} catch (UnsupportedOperationException e) {
// ignore
}
}
Map<File, Movie> movieByFile = new TreeMap<File, Movie>();
// collect useful nfo files even if they are not part of the selected fileset
Set<File> effectiveNfoFileSet = new TreeSet<File>(nfoFiles);

View File

@ -1,17 +1,12 @@
package net.filebot.web;
import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Map;
public interface MovieIdentificationService extends Datasource {
public List<Movie> searchMovie(String query, Locale locale) throws Exception;
List<Movie> searchMovie(String query, Locale locale) throws Exception;
public Movie getMovieDescriptor(Movie movie, Locale locale) throws Exception;
public Map<File, Movie> getMovieDescriptors(Collection<File> movieFiles, Locale locale) throws Exception;
Movie getMovieDescriptor(Movie movie, Locale locale) throws Exception;
}

View File

@ -8,14 +8,12 @@ import static net.filebot.util.JsonUtilities.*;
import static net.filebot.util.StringUtilities.*;
import static net.filebot.web.WebRequest.*;
import java.io.File;
import java.net.URL;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.time.temporal.ChronoField;
import java.time.temporal.TemporalAccessor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.EnumMap;
import java.util.LinkedHashMap;
import java.util.List;
@ -129,11 +127,6 @@ public class OMDbClient implements MovieIdentificationService {
}
}
@Override
public Map<File, Movie> getMovieDescriptors(Collection<File> movieFiles, Locale locale) throws Exception {
throw new UnsupportedOperationException();
}
public Object request(Map<String, Object> parameters) throws Exception {
Cache cache = Cache.getCache(getName(), CacheType.Weekly);
String key = '?' + encodeParameters(parameters, true);

View File

@ -335,7 +335,6 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS
return getMovieDescriptors(singleton(movieFile), locale).get(movieFile);
}
@Override
public synchronized Map<File, Movie> getMovieDescriptors(Collection<File> movieFiles, Locale locale) throws Exception {
// create result array
Map<File, Movie> results = new HashMap<File, Movie>();

View File

@ -9,13 +9,11 @@ import static net.filebot.util.JsonUtilities.*;
import static net.filebot.util.StringUtilities.*;
import static net.filebot.web.WebRequest.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.Serializable;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.EnumMap;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
@ -158,11 +156,6 @@ public class TMDbClient implements MovieIdentificationService {
return null;
}
@Override
public Map<File, Movie> getMovieDescriptors(Collection<File> movieFiles, Locale locale) throws Exception {
throw new UnsupportedOperationException();
}
public MovieInfo getMovieInfo(Movie movie, Locale locale, boolean extendedInfo) throws Exception {
try {
if (movie.getTmdbId() > 0) {