summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-12-17 21:10:48 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-12-17 21:10:48 +0100
commit7f0a644f639e5e4ef9d6ed326df7b8ec833e7de4 (patch)
tree3a4e1437789bbc39cf3c0eb7d7af067b258461c5 /lib/DBInfoscreen
parent4609b7312d67063b2cb0d5803260d7dc25475bc2 (diff)
set version via config
Diffstat (limited to 'lib/DBInfoscreen')
-rw-r--r--lib/DBInfoscreen/Controller/Map.pm4
-rw-r--r--lib/DBInfoscreen/Controller/Static.pm4
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm10
-rw-r--r--lib/DBInfoscreen/Controller/Wagenreihung.pm4
4 files changed, 4 insertions, 18 deletions
diff --git a/lib/DBInfoscreen/Controller/Map.pm b/lib/DBInfoscreen/Controller/Map.pm
index 8e472a6..a8cea9d 100644
--- a/lib/DBInfoscreen/Controller/Map.pm
+++ b/lib/DBInfoscreen/Controller/Map.pm
@@ -12,15 +12,11 @@ use DateTime::Format::Strptime;
use Geo::Distance;
use List::Util qw();
-my $dbf_version = qx{git describe --dirty} || 'experimental';
-
my $strp = DateTime::Format::Strptime->new(
pattern => '%Y-%m-%dT%H:%M:%S%z',
time_zone => 'Europe/Berlin',
);
-chomp $dbf_version;
-
sub get_route_indexes {
my ( $features, $from_name, $to_name ) = @_;
my ( $from_index, $to_index );
diff --git a/lib/DBInfoscreen/Controller/Static.pm b/lib/DBInfoscreen/Controller/Static.pm
index d8872d1..fc309c6 100644
--- a/lib/DBInfoscreen/Controller/Static.pm
+++ b/lib/DBInfoscreen/Controller/Static.pm
@@ -10,8 +10,6 @@ my %default = (
admode => 'deparr',
);
-my $dbf_version = qx{git describe --dirty} || 'experimental';
-
sub redirect {
my ($self) = @_;
my $station = $self->param('station');
@@ -51,7 +49,7 @@ sub about {
$self->render(
'about',
hide_opts => 1,
- version => $dbf_version
+ version => $self->config->{version}
);
}
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 90478a4..752b099 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -23,10 +23,6 @@ use utf8;
no if $] >= 5.018, warnings => 'experimental::smartmatch';
-my $dbf_version = qx{git describe --dirty} || 'experimental';
-
-chomp $dbf_version;
-
my %default = (
backend => 'iris',
mode => 'app',
@@ -229,7 +225,7 @@ sub handle_request {
$self->stash( departures => [] );
$self->stash( title => 'DBF' );
- $self->stash( version => $dbf_version );
+ $self->stash( version => $self->config->{version} );
if ( not( $template ~~ [qw[app infoscreen json multi single text]] ) ) {
$template = 'app';
@@ -704,7 +700,7 @@ sub train_details {
$self->stash( departures => [] );
$self->stash( title => 'DBF' );
- $self->stash( version => $dbf_version );
+ $self->stash( version => $self->config->{version} );
$opt{datetime} = DateTime->now( time_zone => 'Europe/Berlin' )
->subtract( minutes => 20 );
@@ -1227,7 +1223,7 @@ sub handle_result {
departures => \@departures,
ice_type => $self->app->ice_type_map,
station => $station_name,
- version => $dbf_version,
+ version => $self->config->{version},
title => $via ? "$station_name → $via" : $station_name,
refresh_interval => $template eq 'app' ? 0 : 120,
hide_opts => $hide_opts,
diff --git a/lib/DBInfoscreen/Controller/Wagenreihung.pm b/lib/DBInfoscreen/Controller/Wagenreihung.pm
index 92af5f3..498b3b6 100644
--- a/lib/DBInfoscreen/Controller/Wagenreihung.pm
+++ b/lib/DBInfoscreen/Controller/Wagenreihung.pm
@@ -9,10 +9,6 @@ use Mojo::Base 'Mojolicious::Controller';
use Travel::Status::DE::DBWagenreihung;
use Travel::Status::DE::DBWagenreihung::Wagon;
-my $dbf_version = qx{git describe --dirty} || 'experimental';
-
-chomp $dbf_version;
-
sub zugbildung_db {
my ($self) = @_;