summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-05-22 19:08:35 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-05-22 19:08:35 +0200
commit4764fd9a6b1ddedecacf18a0f98d6282217a2b77 (patch)
tree50f9e0ede01ca869fd6d78b2c843392fdd21dbf7
parentcd6df2aa9bd8c272ee6ab6c993733ae0a055ee5a (diff)
route_after: handle passing the same stop more than once2.6.10
-rw-r--r--lib/Travelynx/Model/InTransit.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Travelynx/Model/InTransit.pm b/lib/Travelynx/Model/InTransit.pm
index 6278bad..d825826 100644
--- a/lib/Travelynx/Model/InTransit.pm
+++ b/lib/Travelynx/Model/InTransit.pm
@@ -221,8 +221,15 @@ sub postprocess {
if ($is_after) {
push( @route_after, $station );
}
- if ( $ret->{dep_name}
- and $station->[0] eq $ret->{dep_name} )
+
+ # Note that the departure stop may be present more than once in @route,
+ # e.g. when traveling along ring lines such as S41 / S42 in Berlin.
+ if (
+ $ret->{dep_name}
+ and $station->[0] eq $ret->{dep_name}
+ and not($station->[2]{sched_dep}
+ and $station->[2]{sched_dep} < $ret->{sched_dep_ts} )
+ )
{
$is_after = 1;
if ( @{$station} > 1 and not $dep_info ) {