diff options
author | Daniel Friesel <derf@finalrewind.org> | 2014-11-01 19:45:45 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2014-11-01 19:48:04 +0100 |
commit | 5583505fb32d23a277c357f07340347ab4cd282a (patch) | |
tree | 43a25a57e2ffc08a1ef6983b64521857882c9916 /lib/Travel/Status/DE/IRIS/Result.pm | |
parent | e85076209ad1c1d01a135154b54403c8c00bcc88 (diff) |
allow realtime ppth to override static ppth
This way, if a train has so much delay that its scheduled data was not
requested in the first place, it's still possible to compared its scheduled
route with its actual route
Diffstat (limited to 'lib/Travel/Status/DE/IRIS/Result.pm')
-rw-r--r-- | lib/Travel/Status/DE/IRIS/Result.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm index a121792..930533d 100644 --- a/lib/Travel/Status/DE/IRIS/Result.pm +++ b/lib/Travel/Status/DE/IRIS/Result.pm @@ -118,6 +118,12 @@ sub add_ar { $self->{route_start} = $self->{route_pre}[0]; } + if ( $attrib{sched_route_pre} ) { + $self->{sched_route_pre} + = [ split( qr{[|]}, $attrib{sched_route_pre} // q{} ) ]; + $self->{sched_route_start} = $self->{sched_route_pre}[0]; + } + if ( $attrib{status} and $attrib{status} eq 'c' ) { $self->{is_cancelled} = 1; } @@ -149,6 +155,12 @@ sub add_dp { $self->{route_end} = $self->{route_post}[-1]; } + if ( $attrib{sched_route_post} ) { + $self->{sched_route_post} + = [ split( qr{[|]}, $attrib{sched_route_post} // q{} ) ]; + $self->{sched_route_end} = $self->{sched_route_post}[-1]; + } + if ( $attrib{status} and $attrib{status} eq 'c' ) { $self->{is_cancelled} = 1; } |