From 07ab3f4e9b010a241e9e6091c2b5478e19f752d9 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Mon, 8 Jul 2024 21:05:21 +0200 Subject: store lat/lon along with route This increases resilience against EVA ID reuse --- lib/Travelynx/Helper/HAFAS.pm | 4 +++- lib/Travelynx/Model/InTransit.pm | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/Travelynx') diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm index 538c8ea..2095fb7 100644 --- a/lib/Travelynx/Helper/HAFAS.pm +++ b/lib/Travelynx/Helper/HAFAS.pm @@ -233,7 +233,9 @@ sub get_route_p { rt_dep => _epoch( $stop->rt_dep ), arr_delay => $stop->arr_delay, dep_delay => $stop->dep_delay, - load => $stop->load + load => $stop->load, + lat => $stop->loc->lat, + lon => $stop->loc->lon, }; if ( $stop->tz_offset ) { $entry->{tz_offset} = $stop->tz_offset; diff --git a/lib/Travelynx/Model/InTransit.pm b/lib/Travelynx/Model/InTransit.pm index 6bafd93..f5a1f6d 100644 --- a/lib/Travelynx/Model/InTransit.pm +++ b/lib/Travelynx/Model/InTransit.pm @@ -160,7 +160,9 @@ sub add { rt_dep => _epoch( $j_stop->rt_dep ), arr_delay => $j_stop->arr_delay, dep_delay => $j_stop->dep_delay, - load => $j_stop->load + load => $j_stop->load, + lat => $j_stop->loc->lat, + lon => $j_stop->loc->lon, } ] ); @@ -832,7 +834,9 @@ sub update_arrival_hafas { rt_dep => _epoch( $j_stop->rt_dep ), arr_delay => $j_stop->arr_delay, dep_delay => $j_stop->dep_delay, - load => $j_stop->load + load => $j_stop->load, + lat => $j_stop->loc->lat, + lon => $j_stop->loc->lon, } ] ); -- cgit v1.2.3