Commit 5583505f authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

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
parent e8507620
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
git HEAD

    * Improved support for delayed trains

Travel::Status::DE::IRIS 0.05 - Thu Oct 16 2014

    * Support additional IRIS delay messages
+10 −8
Original line number Diff line number Diff line
@@ -256,6 +256,7 @@ sub get_realtime {
				arrival_ts      => $e_ar->getAttribute('ct'),
				platform        => $e_ar->getAttribute('cp'),
				route_pre       => $e_ar->getAttribute('cpth'),
				sched_route_pre => $e_ar->getAttribute('ppth'),
				status          => $e_ar->getAttribute('cs'),
			);
		}
@@ -264,6 +265,7 @@ sub get_realtime {
				departure_ts     => $e_dp->getAttribute('ct'),
				platform         => $e_dp->getAttribute('cp'),
				route_post       => $e_dp->getAttribute('cpth'),
				sched_route_post => $e_dp->getAttribute('ppth'),
				status           => $e_dp->getAttribute('cs'),
			);
		}
+12 −0
Original line number Diff line number Diff line
@@ -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;
	}
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ is($ice645->raw_id, '1065350279715650378-1401031812-6', '->raw_id');
is($ice645->route_end, 'Berlin Ostbahnhof', '->routd_end');
is($ice645->route_start, 'Köln/Bonn Flughafen', '->routd_start');
is($ice645->sched_route_end, 'Berlin Ostbahnhof', '->sched_route_end');
is($ice645->sched_route_start, 'Köln/Bonn Flughafen', '->sched_routd_start');
is($ice645->sched_route_start, 'Köln/Bonn Flughafen', '->sched_route_start');
is($ice645->stop_no, 6, '->stop_no');
is($ice645->time, '19:23', '->time');
is($ice645->train, 'ICE 645', '->train');