* improved movie matching

This commit is contained in:
Reinhard Pointner 2012-01-02 15:27:20 +00:00
parent 9e6883b646
commit 2f78106db4
3 changed files with 13 additions and 2 deletions

View File

@ -4,6 +4,7 @@ package net.sourceforge.filebot.media;
import static java.util.Collections.*; import static java.util.Collections.*;
import static net.sourceforge.filebot.MediaTypes.*; import static net.sourceforge.filebot.MediaTypes.*;
import static net.sourceforge.filebot.similarity.Normalization.*;
import static net.sourceforge.tuned.FileUtilities.*; import static net.sourceforge.tuned.FileUtilities.*;
import java.io.File; import java.io.File;
@ -379,7 +380,7 @@ public class MediaDetection {
protected String normalize(String source) { protected String normalize(String source) {
String value = transformCache.get(source); String value = transformCache.get(source);
if (value == null) { if (value == null) {
value = super.normalize(source); value = normalizePunctuation(source); // only normalize punctuation, make sure we keep the year (important for movie matching)
transformCache.put(source, value); transformCache.put(source, value);
} }
return transformCache.get(source); return transformCache.get(source);

View File

@ -139,7 +139,12 @@ public class TMDbClient implements MovieIdentificationService {
public MovieInfo getMovieInfo(Movie movie, Locale locale) throws Exception { public MovieInfo getMovieInfo(Movie movie, Locale locale) throws Exception {
URL resource = getResource("Movie.imdbLookup", String.format("tt%07d", movie.getImdbId()), locale); return getMovieInfoByIMDbID(movie.getImdbId(), locale);
}
public MovieInfo getMovieInfoByIMDbID(int imdbid, Locale locale) throws Exception {
URL resource = getResource("Movie.imdbLookup", String.format("tt%07d", imdbid), locale);
Node node = selectNode("//movie", getDocument(resource)); Node node = selectNode("//movie", getDocument(resource));
Map<MovieProperty, String> movieProperties = new EnumMap<MovieProperty, String>(MovieProperty.class); Map<MovieProperty, String> movieProperties = new EnumMap<MovieProperty, String>(MovieProperty.class);

View File

@ -398,6 +398,11 @@ public class TheTVDBClient extends AbstractEpisodeListProvider {
} }
public SeriesInfo getSeriesInfoByIMDbID(int imdbid, Locale locale) throws Exception {
return getSeriesInfo(lookupByIMDbID(imdbid, locale), locale);
}
public SeriesInfo getSeriesInfo(TheTVDBSearchResult searchResult, Locale locale) throws Exception { public SeriesInfo getSeriesInfo(TheTVDBSearchResult searchResult, Locale locale) throws Exception {
// check cache first // check cache first
SeriesInfo cachedItem = getCache().getData("seriesInfo", searchResult.seriesId, locale, SeriesInfo.class); SeriesInfo cachedItem = getCache().getData("seriesInfo", searchResult.seriesId, locale, SeriesInfo.class);