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
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.stream.Stream;
import javax.swing.Icon;
@ -103,7 +104,7 @@ public class TMDbTVClient extends AbstractEpisodeListProvider {
SeriesInfo info = new SeriesInfo(this, sortOrder, locale, series.getId());
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.setLanguage(getString(tv, "original_language"));
info.setStartDate(getStringValue(tv, "first_air_date", SimpleDate::parse));