summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-11-10 09:01:33 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-11-10 09:01:33 +0100
commitcc0dda06d89a5affbfe950a9cca226144d5cc887 (patch)
treef72dab133f81d8f36b946774d30f5e322b497aa0 /lib/DBInfoscreen
parent60b691aa76a3956872ecd841f63546c83dc3ea7f (diff)
single layout: strip non-numeric platform parts for now2.3.12
Diffstat (limited to 'lib/DBInfoscreen')
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 95aa08c..5acd616 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -519,15 +519,24 @@ sub handle_request {
if ( $template eq 'single' ) {
if ( not @platforms ) {
for my $result (@results) {
- if ( not( $result->platform ~~ \@platforms ) ) {
- push( @platforms, $result->platform );
+ if (
+ not( $self->numeric_platform_part( $result->platform ) ~~
+ \@platforms )
+ )
+ {
+ push( @platforms,
+ $self->numeric_platform_part( $result->platform ) );
}
}
@platforms = sort { $a <=> $b } @platforms;
}
my %pcnt;
- @results = grep { $pcnt{ $_->platform }++ < 1 } @results;
- @results = sort { $a->platform <=> $b->platform } @results;
+ @results
+ = grep { $pcnt{ $self->numeric_platform_part( $_->platform ) }++ < 1 }
+ @results;
+ @results = map { $_->[1] }
+ sort { $a->[0] <=> $b->[0] }
+ map { [ $self->numeric_platform_part( $_->platform ), $_ ] } @results;
}
if ( $backend eq 'iris' and $show_realtime ) {