handle ambiguous train numbers when requesting train details
This commit is contained in:
parent
8e5a8fad93
commit
b08b0fb921
1 changed files with 10 additions and 2 deletions
|
@ -1763,8 +1763,16 @@ sub startup {
|
||||||
if ( $suggestion->{depDate} eq $date_yy
|
if ( $suggestion->{depDate} eq $date_yy
|
||||||
or $suggestion->{depDate} eq $date_yyyy )
|
or $suggestion->{depDate} eq $date_yyyy )
|
||||||
{
|
{
|
||||||
$trainlink = $suggestion->{trainLink};
|
# Train numbers are not unique, e.g. IC 149 refers both to the
|
||||||
last;
|
# InterCity service Amsterdam -> Berlin and to the InterCity service
|
||||||
|
# Koebenhavns Lufthavn st -> Aarhus. One workaround is making
|
||||||
|
# requests with the stationFilter=80 parameter. Checking the origin
|
||||||
|
# station seems to be the more generic solution, so we do that
|
||||||
|
# instead.
|
||||||
|
if ( $suggestion->{dep} eq $train->origin ) {
|
||||||
|
$trainlink = $suggestion->{trainLink};
|
||||||
|
last;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue