mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-21 23:38:50 -05:00
Series lookup utilities
This commit is contained in:
parent
851f4b996f
commit
090414ec38
@ -100,6 +100,10 @@ public enum XEM {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
public Optional<SearchResult> getSeries(int id) throws Exception {
|
||||
return getAllNames().stream().filter(r -> id == r.getId()).findFirst();
|
||||
}
|
||||
|
||||
public List<Map<String, Map<String, Number>>> getAll(Integer id) throws Exception {
|
||||
Map<String, Object> parameters = new LinkedHashMap<>(2);
|
||||
parameters.put("origin", getOriginName());
|
||||
@ -117,17 +121,6 @@ public enum XEM {
|
||||
}).findFirst().orElse(emptyMap());
|
||||
}
|
||||
|
||||
public Map<String, Map<String, Number>> getSingle2(Integer id, Integer season, Integer episode) throws Exception {
|
||||
Map<String, Object> parameters = new LinkedHashMap<>(4);
|
||||
parameters.put("origin", getOriginName());
|
||||
parameters.put("id", id);
|
||||
parameters.put("season", season);
|
||||
parameters.put("episode", episode);
|
||||
|
||||
Object response = request("single", parameters);
|
||||
return (Map) getMap(response, "data");
|
||||
}
|
||||
|
||||
public List<SearchResult> getAllNames() throws Exception {
|
||||
return getAllNames(null, null, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user