1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 08:18:52 -05:00

Preserve alias names as best as possible from all fields

This commit is contained in:
Reinhard Pointner 2017-10-01 20:40:35 +02:00
parent af5e0ffd55
commit eaa146bd0a

View File

@ -13,6 +13,7 @@ import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.stream.Stream;
import javax.swing.Icon; import javax.swing.Icon;
@ -103,7 +104,7 @@ public class TMDbTVClient extends AbstractEpisodeListProvider {
SeriesInfo info = new SeriesInfo(this, sortOrder, locale, series.getId()); SeriesInfo info = new SeriesInfo(this, sortOrder, locale, series.getId());
info.setName(originalName != null ? originalName : name); info.setName(originalName != null ? originalName : name);
info.setAliasNames(series.getAliasNames()); info.setAliasNames(Stream.concat(Stream.of(series.getName(), originalName), Stream.of(series.getAliasNames())).filter(Objects::nonNull).filter(s -> !s.equals(name)).distinct().toArray(String[]::new));
info.setStatus(getString(tv, "status")); info.setStatus(getString(tv, "status"));
info.setLanguage(getString(tv, "original_language")); info.setLanguage(getString(tv, "original_language"));
info.setStartDate(getStringValue(tv, "first_air_date", SimpleDate::parse)); info.setStartDate(getStringValue(tv, "first_air_date", SimpleDate::parse));