diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-11-10 09:01:33 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-11-10 09:01:33 +0100 |
commit | cc0dda06d89a5affbfe950a9cca226144d5cc887 (patch) | |
tree | f72dab133f81d8f36b946774d30f5e322b497aa0 /lib/DBInfoscreen.pm | |
parent | 60b691aa76a3956872ecd841f63546c83dc3ea7f (diff) |
single layout: strip non-numeric platform parts for now2.3.12
Diffstat (limited to 'lib/DBInfoscreen.pm')
-rw-r--r-- | lib/DBInfoscreen.pm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index aad1290..b062c9d 100644 --- a/lib/DBInfoscreen.pm +++ b/lib/DBInfoscreen.pm @@ -245,6 +245,26 @@ sub startup { } ); + $self->helper( + 'numeric_platform_part' => sub { + my ( $self, $platform ) = @_; + + if ( not defined $platform ) { + return 0; + } + + if ( $platform =~ m{ ^ \d+ $ }x ) { + return $platform; + } + + if ( $platform =~ m{ (\d+) }x ) { + return $1; + } + + return 0; + } + ); + my $r = $self->routes; $r->get('/_redirect')->to('static#redirect'); |