1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-02 08:25:02 -04:00
This commit is contained in:
Reinhard Pointner 2016-04-10 18:37:13 +00:00
parent af4b46413b
commit 4b25957791
2 changed files with 5 additions and 6 deletions

View File

@ -107,13 +107,13 @@ public class TMDbClient implements MovieIdentificationService {
title = originalTitle;
}
Set<String> alternativeTitles = getAlternativeTitles("movie/" + id, "titles", title, originalTitle, extendedInfo);
String[] alternativeTitles = getAlternativeTitles("movie/" + id, "titles", title, originalTitle, extendedInfo);
return new Movie(title, alternativeTitles.toArray(new String[0]), year, -1, id, locale);
return new Movie(title, alternativeTitles, year, -1, id, locale);
}).filter(Objects::nonNull).collect(toList());
}
protected Set<String> getAlternativeTitles(String path, String key, String title, String originalTitle, boolean extendedInfo) {
protected String[] getAlternativeTitles(String path, String key, String title, String originalTitle, boolean extendedInfo) {
Set<String> alternativeTitles = new LinkedHashSet<String>();
if (originalTitle != null) {
alternativeTitles.add(originalTitle);
@ -133,7 +133,7 @@ public class TMDbClient implements MovieIdentificationService {
// make sure main title is not in the set of alternative titles
alternativeTitles.remove(title);
return alternativeTitles;
return alternativeTitles.toArray(new String[0]);
}
public URI getMoviePageLink(int tmdbid) {

View File

@ -14,7 +14,6 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.stream.Stream;
@ -90,7 +89,7 @@ public class TMDbTVClient extends AbstractEpisodeListProvider {
return null;
}
Set<String> alternativeTitles = tmdb.getAlternativeTitles("tv/" + id, "results", name, originalName, extendedInfo);
String[] alternativeTitles = tmdb.getAlternativeTitles("tv/" + id, "results", name, originalName, extendedInfo);
return new SearchResult(id, name, alternativeTitles);
}).filter(Objects::nonNull).collect(toList());