diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-04-06 10:40:52 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-04-06 10:41:20 +0200 |
commit | fb639e553f15022e865233742914a9e7af99c9f3 (patch) | |
tree | d482f63dab1c6c9853327613b72d348e2f00bd61 /lib/DBInfoscreen/Helper | |
parent | b06b69af7cd8b3a7a767bc4cdae80a35bc7154d8 (diff) |
trainsearch: handle unknown train types4.0.0
IRIS reports unknown train types as "-"; HAFAS wants the train type to be
left out in this case
Diffstat (limited to 'lib/DBInfoscreen/Helper')
-rw-r--r-- | lib/DBInfoscreen/Helper/HAFAS.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm index 8d4c89f..249d308 100644 --- a/lib/DBInfoscreen/Helper/HAFAS.pm +++ b/lib/DBInfoscreen/Helper/HAFAS.pm @@ -204,6 +204,10 @@ sub trainsearch_p { $opt{date_yyyy} = $now->strftime('%d.%m.%Y'); } + # IRIS reports trains with unknown type as type "-". HAFAS thinks otherwise + # and prefers the type to be left out entirely in this case. + $opt{train_req} =~ s{^- }{}; + my $promise = Mojo::Promise->new; $self->get_json_p( $self->{realtime_cache}, |