diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-03-26 21:46:28 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-03-26 21:46:28 +0100 |
commit | 15fa71dbca78899ec4214178440312dd024a5931 (patch) | |
tree | 2d0aa2f80ff965df4cd47565007f535473a37e78 /lib/DBInfoscreen/Controller/Stationboard.pm | |
parent | 3a568e5dbd1b7afd2a872af232e8bd0ff948f48d (diff) |
train details: support non-DB HAFAS backends
Diffstat (limited to 'lib/DBInfoscreen/Controller/Stationboard.pm')
-rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index e2e5bb5..77b0f8d 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -1101,7 +1101,8 @@ sub station_train_details { # /z/:train sub train_details { my ($self) = @_; - my $train = $self->stash('train'); + my $train = $self->stash('train'); + my $hafas = $self->param('hafas'); # TODO error handling @@ -1139,6 +1140,11 @@ sub train_details { $opt{train_no} = $train_no; } + my $service = 'DB'; + if ( $hafas ne '1' and Travel::Status::DE::HAFAS::get_service($hafas) ) { + $opt{service} = $hafas; + } + if ( $self->languages =~ m{^en} ) { $opt{language} = 'en'; } |