Author: Adam Evyčędo <git@apiote.xyz>
update transitous to current motis2
%!v(PANIC=String method: strings: negative Repeat count)
diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/api/transitousDepartures.kt b/app/src/main/java/xyz/apiote/bimba/czwek/api/transitousDepartures.kt index 571253b1be94818ee2b5a9660e1b849e9ad608ab..8441a76e9e6e38c5c8978feaebe9cba650ecc040 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/api/transitousDepartures.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/api/transitousDepartures.kt @@ -58,8 +58,9 @@ } else { latitude = it.place.lat longitude = it.place.lon stopName = it.place.name - Departure( + Event( it.tripId + it.source, + Time.fromOffsetTime(it.place.departure ?: it.place.arrival!!, ZoneId.systemDefault()), Time.fromOffsetTime(it.place.departure ?: it.place.arrival!!, ZoneId.systemDefault()), 0u, it.realTime, @@ -85,7 +86,7 @@ ) } }.filterNotNull() Log.i("stop", "stopID asked: $stop") - StopDepartures( + StopEvents( departures, Stop( stop, diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/repo/LineType.kt b/app/src/main/java/xyz/apiote/bimba/czwek/repo/LineType.kt index 23b70c21de9ad5346c865729fafc721eac726b8c..42a4e6d6607b2df1780b3b834084dc46e3e3d02a 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/repo/LineType.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/repo/LineType.kt @@ -44,25 +44,6 @@ LineTypeV3.MONORAIL -> valueOf("MONORAIL") } } - fun fromTransitous(clasz: Int): LineType { - return when (clasz) { - 0 -> PLANE - 1 -> RAIL - 2 -> RAIL - 3 -> BUS - 4 -> RAIL - 5 -> RAIL - 6 -> RAIL - 7 -> METRO - 8 -> METRO - 9 -> TRAM - 10 -> BUS - 11 -> FERRY - 12 -> UNKNOWN // other - else -> UNKNOWN - } - } - fun fromTransitous2(mode: Mode): LineType { return when(mode) { Mode.AIRPLANE -> PLANE @@ -70,14 +51,6 @@ Mode.WALK -> UNKNOWN Mode.BIKE -> UNKNOWN Mode.CAR -> UNKNOWN Mode.BIKE_RENTAL -> UNKNOWN - Mode.BIKE_TO_PARK -> UNKNOWN - Mode.CAR_TO_PARK -> UNKNOWN - Mode.CAR_HAILING -> UNKNOWN - Mode.CAR_SHARING -> UNKNOWN - Mode.CAR_PICKUP -> UNKNOWN - Mode.CAR_RENTAL -> UNKNOWN - Mode.FLEXIBLE -> UNKNOWN - Mode.SCOOTER_RENTAL -> UNKNOWN Mode.TRANSIT -> UNKNOWN Mode.TRAM -> TRAM Mode.SUBWAY -> METRO @@ -92,6 +65,7 @@ Mode.NIGHT_RAIL -> RAIL Mode.REGIONAL_FAST_RAIL -> RAIL Mode.REGIONAL_RAIL -> RAIL Mode.OTHER -> UNKNOWN + Mode.CAR_PARKING -> UNKNOWN } } }