diff --git a/source/net/filebot/web/AbstractEpisodeListProvider.java b/source/net/filebot/web/AbstractEpisodeListProvider.java index 2aecfe1c..ae23d479 100644 --- a/source/net/filebot/web/AbstractEpisodeListProvider.java +++ b/source/net/filebot/web/AbstractEpisodeListProvider.java @@ -38,7 +38,7 @@ public abstract class AbstractEpisodeListProvider implements EpisodeListProvider @Override public List getEpisodeList(int id, SortOrder order, Locale language) throws Exception { - return getEpisodeList(new SearchResult(id, null), order, language); + return getEpisodeList(new SearchResult(id), order, language); } @Override @@ -48,7 +48,7 @@ public abstract class AbstractEpisodeListProvider implements EpisodeListProvider @Override public SeriesInfo getSeriesInfo(int id, Locale language) throws Exception { - return getSeriesInfo(new SearchResult(id, null), language); + return getSeriesInfo(new SearchResult(id), language); } protected SeriesData getSeriesData(SearchResult searchResult, SortOrder order, Locale language) throws Exception { diff --git a/source/net/filebot/web/SearchResult.java b/source/net/filebot/web/SearchResult.java index 4dc534a9..1f68c318 100644 --- a/source/net/filebot/web/SearchResult.java +++ b/source/net/filebot/web/SearchResult.java @@ -17,6 +17,10 @@ public class SearchResult implements Serializable { // used by serializer } + public SearchResult(int id) { + this(id, null, EMPTY_STRING_ARRAY); + } + public SearchResult(int id, String name) { this(id, name, EMPTY_STRING_ARRAY); } @@ -79,7 +83,7 @@ public class SearchResult implements Serializable { @Override public String toString() { - return name; + return name != null ? name : String.valueOf(id); } @Override diff --git a/source/net/filebot/web/TheTVDBClient.java b/source/net/filebot/web/TheTVDBClient.java index 37ea870f..701fcf49 100644 --- a/source/net/filebot/web/TheTVDBClient.java +++ b/source/net/filebot/web/TheTVDBClient.java @@ -125,7 +125,7 @@ public class TheTVDBClient extends AbstractEpisodeListProvider implements Artwor @Override public TheTVDBSeriesInfo getSeriesInfo(int id, Locale language) throws Exception { - return getSeriesInfo(new SearchResult(id, null), language); + return getSeriesInfo(new SearchResult(id), language); } @Override @@ -230,7 +230,7 @@ public class TheTVDBClient extends AbstractEpisodeListProvider implements Artwor throw new IllegalArgumentException("Illegal TheTVDB ID: " + id); } - SeriesInfo info = getSeriesInfo(new SearchResult(id, null), locale); + SeriesInfo info = getSeriesInfo(new SearchResult(id), locale); return new SearchResult(id, info.getName(), info.getAliasNames()); } diff --git a/source/net/filebot/web/TheTVDBClientV1.java b/source/net/filebot/web/TheTVDBClientV1.java index faccc094..a8aaa987 100644 --- a/source/net/filebot/web/TheTVDBClientV1.java +++ b/source/net/filebot/web/TheTVDBClientV1.java @@ -319,7 +319,7 @@ public class TheTVDBClientV1 extends AbstractEpisodeListProvider implements Artw @Override public TheTVDBSeriesInfo getSeriesInfo(int id, Locale language) throws Exception { - return getSeriesInfo(new SearchResult(id, null), language); + return getSeriesInfo(new SearchResult(id), language); } public TheTVDBSeriesInfo getSeriesInfoByIMDbID(int imdbid, Locale locale) throws Exception {