status card: handle missing realtime data

This commit is contained in:
Daniel Friesel 2022-11-11 19:01:24 +01:00
parent 91db3834ae
commit c92b6bc949
No known key found for this signature in database
GPG key ID: 100D5BFB5166E005
2 changed files with 16 additions and 16 deletions

View file

@ -124,18 +124,18 @@
% if ($station->[0] eq $journey->{arr_name}) { % if ($station->[0] eq $journey->{arr_name}) {
% last; % last;
% } % }
% if (($station->[1]{rt_arr_countdown} // 0) > 0) { % if (($station->[1]{rt_arr_countdown} // 0) > 0 and $station->[1]{rt_arr}) {
<%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %> <%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %>
% if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { % if ($station->[1]{sched_arr} and $station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) {
%= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60);
% } % }
% last; % last;
% } % }
% if (($station->[1]{rt_dep_countdown} // 0) > 0) { % if (($station->[1]{rt_dep_countdown} // 0) > 0 and $station->[1]{rt_arr} and $station->[1]{rt_dep}) {
<%= $station->[0] %><br/> <%= $station->[0] %><br/>
<%= $station->[1]{rt_arr}->strftime('%H:%M') %> → <%= $station->[1]{rt_arr}->strftime('%H:%M') %> →
<%= $station->[1]{rt_dep}->strftime('%H:%M') %> <%= $station->[1]{rt_dep}->strftime('%H:%M') %>
% if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { % if ($station->[1]{sched_dep} and $station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) {
%= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60);
% } % }
% last; % last;
@ -149,18 +149,18 @@
% if ($station->[0] eq $journey->{arr_name}) { % if ($station->[0] eq $journey->{arr_name}) {
% last; % last;
% } % }
% if (($station->[1]{rt_arr_countdown} // 0) > 0) { % if (($station->[1]{rt_arr_countdown} // 0) > 0 and $station->[1]{rt_arr}) {
<%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %> <%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %>
% if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { % if ($station->[1]{sched_arr} and $station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) {
%= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60);
% } % }
% last; % last;
% } % }
% if (($station->[1]{rt_dep_countdown} // 0) > 0) { % if (($station->[1]{rt_dep_countdown} // 0) > 0 and $station->[1]{rt_arr} and $station->[1]{rt_dep}) {
<%= $station->[0] %><br/> <%= $station->[0] %><br/>
<%= $station->[1]{rt_arr}->strftime('%H:%M') %> → <%= $station->[1]{rt_arr}->strftime('%H:%M') %> →
<%= $station->[1]{rt_dep}->strftime('%H:%M') %> <%= $station->[1]{rt_dep}->strftime('%H:%M') %>
% if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { % if ($station->[1]{sched_dep} and $station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) {
%= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60);
% } % }
% last; % last;

View file

@ -79,18 +79,18 @@
% if ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}) { % if ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}) {
% last; % last;
% } % }
% if (($station->[1]{rt_arr_countdown} // 0) > 0) { % if (($station->[1]{rt_arr_countdown} // 0) > 0 and $station->[1]{rt_arr}) {
<%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %> <%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %>
% if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { % if ($station->[1]{sched_arr} and $station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) {
%= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60);
% } % }
% last; % last;
% } % }
% if (($station->[1]{rt_dep_countdown} // 0) > 0) { % if (($station->[1]{rt_dep_countdown} // 0) > 0 and $station->[1]{rt_arr} and $station->[1]{rt_dep}) {
<%= $station->[0] %><br/> <%= $station->[0] %><br/>
<%= $station->[1]{rt_arr}->strftime('%H:%M') %> → <%= $station->[1]{rt_arr}->strftime('%H:%M') %> →
<%= $station->[1]{rt_dep}->strftime('%H:%M') %> <%= $station->[1]{rt_dep}->strftime('%H:%M') %>
% if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { % if ($station->[1]{sched_dep} and $station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) {
%= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60);
% } % }
% last; % last;
@ -104,20 +104,20 @@
% if ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}) { % if ($journey->{arr_name} and $station->[0] eq $journey->{arr_name}) {
% last; % last;
% } % }
% if (($station->[1]{rt_arr_countdown} // 0) > 0) { % if (($station->[1]{rt_arr_countdown} // 0) > 0 and $station->[1]{rt_arr}) {
Nächster Halt:<br/> Nächster Halt:<br/>
<%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %> <%= $station->[0] %><br/><%= $station->[1]{rt_arr}->strftime('%H:%M') %>
% if ($station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) { % if ($station->[1]{sched_arr} and $station->[1]{sched_arr}->epoch != $station->[1]{rt_arr}->epoch) {
%= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60); %= sprintf('(%+d)', ($station->[1]{rt_arr}->epoch - $station->[1]{sched_arr}->epoch ) / 60);
% } % }
% last; % last;
% } % }
% if (($station->[1]{rt_dep_countdown} // 0) > 0) { % if (($station->[1]{rt_dep_countdown} // 0) > 0 and $station->[1]{rt_arr} and $station->[1]{rt_dep}) {
Aktueller Halt:<br/> Aktueller Halt:<br/>
<%= $station->[0] %><br/> <%= $station->[0] %><br/>
<%= $station->[1]{rt_arr}->strftime('%H:%M') %> → <%= $station->[1]{rt_arr}->strftime('%H:%M') %> →
<%= $station->[1]{rt_dep}->strftime('%H:%M') %> <%= $station->[1]{rt_dep}->strftime('%H:%M') %>
% if ($station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) { % if ($station->[1]{sched_dep} and $station->[1]{sched_dep}->epoch != $station->[1]{rt_dep}->epoch) {
%= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60); %= sprintf('(%+d)', ($station->[1]{rt_dep}->epoch - $station->[1]{sched_dep}->epoch ) / 60);
% } % }
% last; % last;