This commit is contained in:
Reinhard Pointner 2019-06-13 12:04:41 +07:00
parent b960432c52
commit a029bdf94c
1 changed files with 6 additions and 2 deletions

View File

@ -48,12 +48,16 @@ public enum XEM {
public String getSeriesName(Map<String, List<String>> n, Integer s) {
switch (this) {
case AniDB:
return s == null ? null : n.get(Integer.toString(s)).get(0);
return s == null ? null : first(n.get(String.valueOf(s)));
default:
return n.get("all").get(0);
return first(n.get("all"));
}
}
private String first(List<String> values) {
return values == null || values.isEmpty() ? null : values.get(0);
}
protected final Resource<Set<Integer>> haveMap = Resource.lazy(this::getHaveMap);
public Optional<Episode> map(Episode episode, XEM destination) throws Exception {