mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-10 20:48:47 +00:00
NegentweeProvider: Skip cancelled trips.
This commit is contained in:
parent
cc9307b587
commit
fa418ddbe3
1 changed files with 4 additions and 2 deletions
|
@ -622,8 +622,10 @@ public class NegentweeProvider extends AbstractNetworkProvider {
|
||||||
for (int i = 0; i < trips.length(); i++) {
|
for (int i = 0; i < trips.length(); i++) {
|
||||||
JSONObject trip = trips.getJSONObject(i);
|
JSONObject trip = trips.getJSONObject(i);
|
||||||
|
|
||||||
// Skip impossible trips
|
// Skip impossible or cancelled trips
|
||||||
if (trip.getJSONObject("realtimeInfo").getString("delays").equals("fatal"))
|
JSONObject realtimeInfo = trip.optJSONObject("realtimeInfo");
|
||||||
|
if (realtimeInfo != null && ("fatal".equals(realtimeInfo.optString("delays"))
|
||||||
|
|| "cancellations".equals(realtimeInfo.optString("cancellations"))))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
foundTrips.add(tripFromJSONObject(trip, from, to, disturbancesMap));
|
foundTrips.add(tripFromJSONObject(trip, from, to, disturbancesMap));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue