mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 08:48:51 -05:00
* improved movie matching
This commit is contained in:
parent
9e6883b646
commit
2f78106db4
@ -4,6 +4,7 @@ package net.sourceforge.filebot.media;
|
||||
|
||||
import static java.util.Collections.*;
|
||||
import static net.sourceforge.filebot.MediaTypes.*;
|
||||
import static net.sourceforge.filebot.similarity.Normalization.*;
|
||||
import static net.sourceforge.tuned.FileUtilities.*;
|
||||
|
||||
import java.io.File;
|
||||
@ -379,7 +380,7 @@ public class MediaDetection {
|
||||
protected String normalize(String source) {
|
||||
String value = transformCache.get(source);
|
||||
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);
|
||||
}
|
||||
return transformCache.get(source);
|
||||
|
@ -139,7 +139,12 @@ public class TMDbClient implements MovieIdentificationService {
|
||||
|
||||
|
||||
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));
|
||||
|
||||
Map<MovieProperty, String> movieProperties = new EnumMap<MovieProperty, String>(MovieProperty.class);
|
||||
|
@ -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 {
|
||||
// check cache first
|
||||
SeriesInfo cachedItem = getCache().getData("seriesInfo", searchResult.seriesId, locale, SeriesInfo.class);
|
||||
|
Loading…
Reference in New Issue
Block a user