Loading lib/Travelynx/Model/InTransit.pm +66 −41 Original line number Diff line number Diff line Loading @@ -158,7 +158,6 @@ sub add { sched_dep => _epoch( $j_stop->sched_dep ), rt_arr => _epoch( $j_stop->rt_arr ), rt_dep => _epoch( $j_stop->rt_dep ), isCancelled => $j_stop->is_cancelled, arr_delay => $j_stop->arr_delay, dep_delay => $j_stop->dep_delay, platform => $j_stop->platform, Loading @@ -168,6 +167,9 @@ sub add { } ] ); if ( $j_stop->is_cancelled ) { $route[-1][2]{isCancelled} = 1; } } $persistent_data->{operator} = $journey->operator; $db->insert( Loading Loading @@ -284,7 +286,6 @@ sub add { sched_dep => _epoch( $j_stop->sched_dep ), rt_arr => _epoch( $j_stop->rt_arr ), rt_dep => _epoch( $j_stop->rt_dep ), isCancelled => $j_stop->is_cancelled, arr_delay => $j_stop->arr_delay, dep_delay => $j_stop->dep_delay, platform => $j_stop->platform, Loading @@ -297,6 +298,12 @@ sub add { } ] ); if ( $j_stop->is_additional ) { $route[-1][2]{isAdditional} = 1; } if ( $j_stop->is_cancelled ) { $route[-1][2]{isCancelled} = 1; } } my @messages; for my $msg ( $journey->messages ) { Loading Loading @@ -517,6 +524,14 @@ sub postprocess { $ret->{comment} = $ret->{user_data}{comment}; $ret->{wagongroups} = $ret->{user_data}{wagongroups}; if ( $ret->{sched_dep_ts} and $ret->{real_dep_ts} ) { $ret->{dep_delay} = $ret->{real_dep_ts} - $ret->{sched_dep_ts}; } if ( $ret->{sched_arr_ts} and $ret->{real_arr_ts} ) { $ret->{arr_delay} = $ret->{real_arr_ts} - $ret->{sched_arr_ts}; } $ret->{platform_type} = 'Gleis'; if ( $ret->{train_type} and $ret->{train_type} =~ m{ ast | bus | ruf }ix ) { $ret->{platform_type} = 'Steig'; Loading Loading @@ -1254,7 +1269,6 @@ sub update_arrival_dbris { rt_arr => _epoch( $j_stop->rt_arr ), rt_dep => _epoch( $j_stop->rt_dep ), platform => $j_stop->platform, isCancelled => $j_stop->is_cancelled, arr_delay => $j_stop->arr_delay, dep_delay => $j_stop->dep_delay, platform => $j_stop->platform, Loading @@ -1267,6 +1281,12 @@ sub update_arrival_dbris { } ] ); if ( $j_stop->is_additional ) { $route[-1][2]{isAdditional} = 1; } if ( $j_stop->is_cancelled ) { $route[-1][2]{isCancelled} = 1; } } # selecting on user_id and train_no avoids a race condition if a user checks Loading Loading @@ -1322,7 +1342,6 @@ sub update_arrival_efa { sched_dep => _epoch( $j_stop->sched_dep ), rt_arr => _epoch( $j_stop->rt_arr ), rt_dep => _epoch( $j_stop->rt_dep ), isCancelled => $j_stop->is_cancelled, arr_delay => $j_stop->arr_delay, dep_delay => $j_stop->dep_delay, platform => $j_stop->platform, Loading @@ -1332,7 +1351,13 @@ sub update_arrival_efa { } ] ); if ( $j_stop->is_cancelled ) { $route[-1][2]{isCancelled} = 1; } } # TODO set efa_load from old route entry if missing in current route entry # (at least in VVO, occupancy data is only provided for future stops) # selecting on user_id and train_no avoids a race condition if a user checks # into a new train while we are fetching data for their previous journey. In Loading Loading
lib/Travelynx/Model/InTransit.pm +66 −41 Original line number Diff line number Diff line Loading @@ -158,7 +158,6 @@ sub add { sched_dep => _epoch( $j_stop->sched_dep ), rt_arr => _epoch( $j_stop->rt_arr ), rt_dep => _epoch( $j_stop->rt_dep ), isCancelled => $j_stop->is_cancelled, arr_delay => $j_stop->arr_delay, dep_delay => $j_stop->dep_delay, platform => $j_stop->platform, Loading @@ -168,6 +167,9 @@ sub add { } ] ); if ( $j_stop->is_cancelled ) { $route[-1][2]{isCancelled} = 1; } } $persistent_data->{operator} = $journey->operator; $db->insert( Loading Loading @@ -284,7 +286,6 @@ sub add { sched_dep => _epoch( $j_stop->sched_dep ), rt_arr => _epoch( $j_stop->rt_arr ), rt_dep => _epoch( $j_stop->rt_dep ), isCancelled => $j_stop->is_cancelled, arr_delay => $j_stop->arr_delay, dep_delay => $j_stop->dep_delay, platform => $j_stop->platform, Loading @@ -297,6 +298,12 @@ sub add { } ] ); if ( $j_stop->is_additional ) { $route[-1][2]{isAdditional} = 1; } if ( $j_stop->is_cancelled ) { $route[-1][2]{isCancelled} = 1; } } my @messages; for my $msg ( $journey->messages ) { Loading Loading @@ -517,6 +524,14 @@ sub postprocess { $ret->{comment} = $ret->{user_data}{comment}; $ret->{wagongroups} = $ret->{user_data}{wagongroups}; if ( $ret->{sched_dep_ts} and $ret->{real_dep_ts} ) { $ret->{dep_delay} = $ret->{real_dep_ts} - $ret->{sched_dep_ts}; } if ( $ret->{sched_arr_ts} and $ret->{real_arr_ts} ) { $ret->{arr_delay} = $ret->{real_arr_ts} - $ret->{sched_arr_ts}; } $ret->{platform_type} = 'Gleis'; if ( $ret->{train_type} and $ret->{train_type} =~ m{ ast | bus | ruf }ix ) { $ret->{platform_type} = 'Steig'; Loading Loading @@ -1254,7 +1269,6 @@ sub update_arrival_dbris { rt_arr => _epoch( $j_stop->rt_arr ), rt_dep => _epoch( $j_stop->rt_dep ), platform => $j_stop->platform, isCancelled => $j_stop->is_cancelled, arr_delay => $j_stop->arr_delay, dep_delay => $j_stop->dep_delay, platform => $j_stop->platform, Loading @@ -1267,6 +1281,12 @@ sub update_arrival_dbris { } ] ); if ( $j_stop->is_additional ) { $route[-1][2]{isAdditional} = 1; } if ( $j_stop->is_cancelled ) { $route[-1][2]{isCancelled} = 1; } } # selecting on user_id and train_no avoids a race condition if a user checks Loading Loading @@ -1322,7 +1342,6 @@ sub update_arrival_efa { sched_dep => _epoch( $j_stop->sched_dep ), rt_arr => _epoch( $j_stop->rt_arr ), rt_dep => _epoch( $j_stop->rt_dep ), isCancelled => $j_stop->is_cancelled, arr_delay => $j_stop->arr_delay, dep_delay => $j_stop->dep_delay, platform => $j_stop->platform, Loading @@ -1332,7 +1351,13 @@ sub update_arrival_efa { } ] ); if ( $j_stop->is_cancelled ) { $route[-1][2]{isCancelled} = 1; } } # TODO set efa_load from old route entry if missing in current route entry # (at least in VVO, occupancy data is only provided for future stops) # selecting on user_id and train_no avoids a race condition if a user checks # into a new train while we are fetching data for their previous journey. In Loading