Skip to content

Commit

Permalink
fix for missing departure time in minutes from Wiener Linien API
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnavratil committed Aug 29, 2018
1 parent 7f5c3d2 commit 1b5a4a0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ private Map<Integer, List<MonitorResponse>> extractRealtimeData(String responseB
final String towards = line.get("towards").as(String.class);
final List<Any> jsonDepartureList = line.get("departures").get("departure").asList();
final List<Integer> departureList = new ArrayList<>(jsonDepartureList.size());
jsonDepartureList.forEach(departure -> departureList.add(departure.get("departureTime").get("countdown").as(Integer.class)));
jsonDepartureList
.stream()
.filter(departure -> departure.get("departureTime").keys().contains("countdown"))
.forEach(departure -> departureList.add(departure.get("departureTime").get("countdown").as(Integer.class)));
monitorResponseList.add(new MonitorResponse(lineName, towards, departureList));
});
responseMap.put(currentRbl, monitorResponseList);
Expand Down

0 comments on commit 1b5a4a0

Please sign in to comment.