diff options
| -rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 28 | ||||
| -rw-r--r-- | templates/app.html.ep | 9 | 
2 files changed, 27 insertions, 10 deletions
| diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 3e5a6bf..c5d27ab 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -1862,16 +1862,28 @@ sub handle_result {  			@results = sort { $a->datetime <=> $b->datetime } @results;  		}  		elsif ( $admode eq 'arr' ) { -			@results = sort { -				( $a->arrival // $a->departure ) -				  <=> ( $b->arrival // $b->departure ) -			} @results; +			@results = map { $_->[1] } +			  sort { $a->[0] <=> $b->[0] } +			  map { +				[ +					$_->arrival_is_cancelled +					? ( $_->sched_arrival // $_->sched_departure ) +					: ( $_->arrival // $_->departure ), +					$_ +				] +			  } @results;  		}  		else { -			@results = sort { -				( $a->departure // $a->arrival ) -				  <=> ( $b->departure // $b->arrival ) -			} @results; +			@results = map { $_->[1] } +			  sort { $a->[0] <=> $b->[0] } +			  map { +				[ +					$_->departure_is_cancelled +					? ( $_->sched_departure // $_->sched_arrival ) +					: ( $_->departure // $_->arrival ), +					$_ +				] +			  } @results;  		}  	} diff --git a/templates/app.html.ep b/templates/app.html.ep index 9356e27..8eec9a7 100644 --- a/templates/app.html.ep +++ b/templates/app.html.ep @@ -104,7 +104,7 @@        </span>  %   }      <span class="time <%= $show_realtime ? get_rt_time_class($departure) : q{} %>"> -%     if ($departure->{delay} and not $departure->{is_cancelled}) { +%     if ($departure->{delay} and not $departure->{is_cancelled} and not $departure->{departure_is_cancelled}) {  %       if ($show_realtime and ($departure->{sched_arrival} or $departure->{sched_departure})) {  %         if ($departure->{delay} > ($hide_low_delay ? 4 : 0)) {              <span class="delaynorm" aria-hidden="true"><%= $departure->{sched_departure} // $departure->{sched_arrival} %> ⇒</span> @@ -142,7 +142,12 @@  %       }  %     }  %     else { -%=      $departure->{time} +%       if ($departure->{is_cancelled} or $departure->{departure_is_cancelled}) { +%=        $departure->{sched_departure} // $departure->{sched_arrival} // $departure->{time} +%       } +%       else { +%=        $departure->{time} +%       }  %     }      </span>  %   if (($departure->{scheduled_platform} and $departure->{platform} and | 
