This commit is contained in:
Reinhard Pointner 2017-02-24 16:44:30 +08:00
parent 102ce41728
commit 0a92f100ae
4 changed files with 10 additions and 6 deletions

View File

@ -38,7 +38,7 @@ public abstract class AbstractEpisodeListProvider implements EpisodeListProvider
@Override @Override
public List<Episode> getEpisodeList(int id, SortOrder order, Locale language) throws Exception { public List<Episode> 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 @Override
@ -48,7 +48,7 @@ public abstract class AbstractEpisodeListProvider implements EpisodeListProvider
@Override @Override
public SeriesInfo getSeriesInfo(int id, Locale language) throws Exception { 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 { protected SeriesData getSeriesData(SearchResult searchResult, SortOrder order, Locale language) throws Exception {

View File

@ -17,6 +17,10 @@ public class SearchResult implements Serializable {
// used by serializer // used by serializer
} }
public SearchResult(int id) {
this(id, null, EMPTY_STRING_ARRAY);
}
public SearchResult(int id, String name) { public SearchResult(int id, String name) {
this(id, name, EMPTY_STRING_ARRAY); this(id, name, EMPTY_STRING_ARRAY);
} }
@ -79,7 +83,7 @@ public class SearchResult implements Serializable {
@Override @Override
public String toString() { public String toString() {
return name; return name != null ? name : String.valueOf(id);
} }
@Override @Override

View File

@ -125,7 +125,7 @@ public class TheTVDBClient extends AbstractEpisodeListProvider implements Artwor
@Override @Override
public TheTVDBSeriesInfo getSeriesInfo(int id, Locale language) throws Exception { public TheTVDBSeriesInfo getSeriesInfo(int id, Locale language) throws Exception {
return getSeriesInfo(new SearchResult(id, null), language); return getSeriesInfo(new SearchResult(id), language);
} }
@Override @Override
@ -230,7 +230,7 @@ public class TheTVDBClient extends AbstractEpisodeListProvider implements Artwor
throw new IllegalArgumentException("Illegal TheTVDB ID: " + id); 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()); return new SearchResult(id, info.getName(), info.getAliasNames());
} }

View File

@ -319,7 +319,7 @@ public class TheTVDBClientV1 extends AbstractEpisodeListProvider implements Artw
@Override @Override
public TheTVDBSeriesInfo getSeriesInfo(int id, Locale language) throws Exception { 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 { public TheTVDBSeriesInfo getSeriesInfoByIMDbID(int imdbid, Locale locale) throws Exception {