improve inconsistency list
This commit is contained in:
parent
16cdc3d10a
commit
3da22fc8f9
3 changed files with 39 additions and 9 deletions
|
@ -1300,6 +1300,18 @@ my @migrations = (
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
# v31 -> v32
|
||||||
|
# travelynx v1.29.18 improves above-mentioned conflict links.
|
||||||
|
sub {
|
||||||
|
my ($db) = @_;
|
||||||
|
$db->query(
|
||||||
|
qq{
|
||||||
|
truncate journey_stats;
|
||||||
|
update schema_version set version = 32;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
sub sync_stations {
|
sub sync_stations {
|
||||||
|
|
|
@ -1458,6 +1458,8 @@ sub compute_stats {
|
||||||
my @inconsistencies;
|
my @inconsistencies;
|
||||||
|
|
||||||
my $next_departure = 0;
|
my $next_departure = 0;
|
||||||
|
my $next_id;
|
||||||
|
my $next_train;
|
||||||
|
|
||||||
for my $journey (@journeys) {
|
for my $journey (@journeys) {
|
||||||
$num_trains++;
|
$num_trains++;
|
||||||
|
@ -1488,11 +1490,21 @@ sub compute_stats {
|
||||||
if ( $next_departure - $journey->{rt_arr_ts} < 0 ) {
|
if ( $next_departure - $journey->{rt_arr_ts} < 0 ) {
|
||||||
push(
|
push(
|
||||||
@inconsistencies,
|
@inconsistencies,
|
||||||
[
|
{
|
||||||
epoch_to_dt($next_departure)
|
conflict => {
|
||||||
|
train => $journey->{type} . ' '
|
||||||
|
. ( $journey->{line} // $journey->{no} ),
|
||||||
|
arr => epoch_to_dt( $journey->{rt_arr_ts} )
|
||||||
->strftime('%d.%m.%Y %H:%M'),
|
->strftime('%d.%m.%Y %H:%M'),
|
||||||
$journey->{id}
|
id => $journey->{id},
|
||||||
]
|
},
|
||||||
|
ignored => {
|
||||||
|
train => $next_train,
|
||||||
|
dep => epoch_to_dt($next_departure)
|
||||||
|
->strftime('%d.%m.%Y %H:%M'),
|
||||||
|
id => $next_id,
|
||||||
|
},
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1504,6 +1516,9 @@ sub compute_stats {
|
||||||
$num_journeys++;
|
$num_journeys++;
|
||||||
}
|
}
|
||||||
$next_departure = $journey->{rt_dep_ts};
|
$next_departure = $journey->{rt_dep_ts};
|
||||||
|
$next_id = $journey->{id};
|
||||||
|
$next_train
|
||||||
|
= $journey->{type} . ' ' . ( $journey->{line} // $journey->{no} ),;
|
||||||
}
|
}
|
||||||
my $ret = {
|
my $ret = {
|
||||||
km_route => $km_route,
|
km_route => $km_route,
|
||||||
|
|
|
@ -6,12 +6,15 @@
|
||||||
<i class="material-icons small right">warning</i>
|
<i class="material-icons small right">warning</i>
|
||||||
<span class="card-title">Inkonsistente Reisedaten</span>
|
<span class="card-title">Inkonsistente Reisedaten</span>
|
||||||
<p>
|
<p>
|
||||||
Die folgenden Abfahrtszeiten liegen vor der Ankunftszeit der
|
Die folgenden Zugfahrten wurden bei der Wartezeitberechnung
|
||||||
vorherigen Zugfahrt und wurden bei der Wartezeitberechnung
|
ignoriert, da ihre Abfahrtszeit vor der Ankunftszeit der
|
||||||
ignoriert.
|
vorherigen Zugfahrt liegt. Bei den restlichen Statistken
|
||||||
|
wurden sie mitberücksichtigt.
|
||||||
<ul>
|
<ul>
|
||||||
% for my $field (@{$stats->{inconsistencies}}) {
|
% for my $field (@{$stats->{inconsistencies}}) {
|
||||||
<li><a href="/journey/<%= $field->[1] %>"><%= $field->[0] %></a></li>
|
<li><a href="/journey/<%= $field->{ignored}{id} %>"><%= $field->{ignored}{train} %> ab <%= $field->{ignored}{dep} %></a>
|
||||||
|
(Konflikt: <a href="/journey/<%= $field->{conflict}{id} %>"><%= $field->{conflict}{train} %> an <%= $field->{conflict}{arr} %>)</a>
|
||||||
|
</li>
|
||||||
% }
|
% }
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Reference in a new issue