summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Controller/Stationboard.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2025-01-16 18:32:17 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2025-01-16 18:32:17 +0100
commit9095b829914324c284b5208f8b8ac088de28b7d3 (patch)
tree31bf665b424c1687aea6173be4bb364ab8e07a12 /lib/DBInfoscreen/Controller/Stationboard.pm
parent87e168578bef45ef98caa72da9d2fb3519e1d032 (diff)
stationboard: IRIS: always show cancelled trains with scheduled timeHEAD4.33.4main
Diffstat (limited to 'lib/DBInfoscreen/Controller/Stationboard.pm')
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm28
1 files changed, 20 insertions, 8 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;
}
}