mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-02 08:25:02 -04:00
Refactor
This commit is contained in:
parent
af4b46413b
commit
4b25957791
@ -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) {
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user