aboutsummaryrefslogtreecommitdiff
path: root/lib/Server
diff options
context:
space:
mode:
authorstuebinm2023-05-26 21:07:48 +0200
committerstuebinm2023-05-26 21:14:20 +0200
commite029a031050e08599f9d6d5fa654c17d985039c1 (patch)
tree3b4dd35bf6f6a8495b47ac5158a954151c9c0b55 /lib/Server
parent8737181eac0dce062ff0541e263ba0bf6a772c66 (diff)
expose sequence length of trip to onboard unit
Diffstat (limited to '')
-rw-r--r--lib/Server.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Server.hs b/lib/Server.hs
index d6e9955..7ebaca5 100644
--- a/lib/Server.hs
+++ b/lib/Server.hs
@@ -107,6 +107,7 @@ server gtfs@GTFS{..} Metrics{..} subscribers dbpool settings = handleDebugAPI
where mkJson :: Trip Deep Deep -> A.Value
mkJson Trip {..} = A.object
[ "trip" .= tripTripID
+ , "sequencelength" .= (stopSequence . V.last) tripStops
, "stops" .= fmap (\Stop{..} -> A.object
[ "departure" .= stopDeparture
, "station" .= stationId stopStation