diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-03-29 16:42:24 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-03-29 16:42:47 +0100 |
commit | 0252ff2697d80c10c2932893995f0e77f85a38ec (patch) | |
tree | 36eba7f269cf07ce2daa7d0553c5a8f01dafe1c5 /lib/Travelynx/Model/InTransit.pm | |
parent | 84d6e23c494eea178cfe55c215ecec2b7c547195 (diff) |
pass train suffix (which is sometimes line ID) on to InTransit->add
Closes #217
Diffstat (limited to 'lib/Travelynx/Model/InTransit.pm')
-rw-r--r-- | lib/Travelynx/Model/InTransit.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Travelynx/Model/InTransit.pm b/lib/Travelynx/Model/InTransit.pm index 34c78f7..bf117bf 100644 --- a/lib/Travelynx/Model/InTransit.pm +++ b/lib/Travelynx/Model/InTransit.pm @@ -95,6 +95,7 @@ sub add { my $db = $opt{db} // $self->{pg}->db; my $backend_id = $opt{backend_id}; my $train = $opt{train}; + my $train_suffix = $opt{train_suffix}; my $journey = $opt{journey}; my $stop = $opt{stop}; my $checkin_station_id = $opt{departure_eva}; @@ -194,6 +195,14 @@ sub add { } elsif ( $journey and $stop ) { + my $line; + if ( $train_suffix + and $journey->number + and $train_suffix ne $journey->number ) + { + $line = $train_suffix; + } + # DBRIS my @route; for my $j_stop ( $journey->route ) { @@ -231,6 +240,7 @@ sub add { checkin_time => DateTime->now( time_zone => 'Europe/Berlin' ), dep_platform => $stop->platform, train_type => $journey->type, + train_line => $line, train_no => $journey->number, train_id => $data->{trip_id}, sched_departure => $stop->sched_dep, |