diff options
author | Daniel Friesel <derf@finalrewind.org> | 2014-11-23 23:14:43 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2014-11-23 23:14:43 +0100 |
commit | eeb777112f61ec4f133c8f890ff76aeaabf5729e (patch) | |
tree | 2a00d636ca6f63251184a578e59e9516c247ce3c | |
parent | 3de321ae123e8caad330678d98bc21fc6edcf551 (diff) |
IRIS backend: try get_station first
-rw-r--r-- | index.pl | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -33,6 +33,16 @@ sub get_results_for { if ( not $results ) { if ( $backend eq 'iris' ) { + + # requests with DS100 codes should be preferred (they avoid + # encoding problems on the IRIS server). However, only use them + # if we have an exact match. Ask the backend otherwise. + my @station_matches + = Travel::Status::DE::IRIS::Stations::get_station($station); + if ( @station_matches == 1 ) { + $station = $station_matches[0][0]; + } + my $status = Travel::Status::DE::IRIS->new( station => $station, serializable => 1 |