Loading lib/DBInfoscreen/Controller/Stationboard.pm +17 −4 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ use DateTime; use DateTime::Format::Strptime; use Encode qw(decode encode); use File::Slurp qw(read_file write_file); use List::Util qw(max); use List::Util qw(max uniq); use List::MoreUtils qw(); use Mojo::JSON qw(decode_json); use Mojo::Promise; Loading Loading @@ -789,6 +789,20 @@ sub render_train { return; } )->wait; $departure->{composition} = $self->app->train_details_db->{ $departure->{train_no} }; my @cycle_from; my @cycle_to; for my $cycle ( values %{ $departure->{composition}->{cycle} // {} } ) { push( @cycle_from, @{ $cycle->{from} // [] } ); push( @cycle_to, @{ $cycle->{to} // [] } ); } @cycle_from = sort { $a <=> $b } uniq @cycle_from; @cycle_to = sort { $a <=> $b } uniq @cycle_to; $departure->{cycle_from} = [ map { [ $_, $self->app->train_details_db->{$_} ] } @cycle_from ]; $departure->{cycle_to} = [ map { [ $_, $self->app->train_details_db->{$_} ] } @cycle_to ]; } # Defer rendering until all requests have completed Loading @@ -799,8 +813,7 @@ sub render_train { departure => $departure, linetype => $linetype, icetype => $self->app->ice_type_map->{ $departure->{train_no} }, details => $self->app->train_details_db->{ $departure->{train_no} }, details => $departure->{composition} // {}, dt_now => DateTime->now( time_zone => 'Europe/Berlin' ), station_name => $station_name, nav_link => Loading lib/DBInfoscreen/Helper/Wagonorder.pm +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ sub has_cycle_p { my ( $self, $train_no ) = @_; return $self->head_dbdb_p( "https://lib.finalrewind.org/dbdb/db_umlauf/${train_no}.png"); "https://lib.finalrewind.org/dbdb/db_umlauf/${train_no}.svg"); } sub check_wagonorder_p { Loading share/zugbildungsplan.json +1 −1 File changed.Preview size limit exceeded, changes collapsed. Show changes templates/_train_details.html.ep +10 −10 Original line number Diff line number Diff line Loading @@ -228,10 +228,10 @@ % } </ul> <!-- mroute --> % } % if (param('detailed') and $departure->{has_cycle}) { % if ($departure->{has_cycle}) { <div class="db-attr"><a href="https://lib.finalrewind.org/dbdb/db_umlauf/<%= $departure->{train_no} %>.svg">Umlaufplan</a></div> % } % if (param('detailed') and $details->{commonAttr}) { % if ($details->{commonAttr}) { % if ($details->{attrVariants} and (not $details->{commonAttr}{vmax} or not $details->{commonAttr}{brakingPercentage})) { <div class="db-attr"> Attribute: Loading @@ -248,15 +248,15 @@ </div> % } % } % if (param('detailed') and $details and not $departure->{arrival}) { % if ($details and not $departure->{arrival}) { % if (my $s = $details->{route}{preStart}) { Zug wird voraussichtlich aus <%= $s %> eingesetzt.<br/><br/> % } % if ($details->{cycle}{from}) { % if (@{$departure->{cycle_from} // []}) { Bildung möglicherweise aus <ul> % for my $train_no (sort {$a <=> $b} @{ $details->{cycle}{from} // [] }) { % my $train = app->train_details_db->{$train_no}; % for my $t (@{$departure->{cycle_from}}) { % my ($train_no, $train) = @{$t}; % my $tt = $train->{type} // $train->{rawType} // 'Zug'; % $tt =~ s{ .*|[0-9]}{}; <li><%= $tt %> <%= $train_no %> Loading @@ -268,15 +268,15 @@ </ul> % } % } % elsif (param('detailed') and $details and not $departure->{departure}) { % elsif ($details and not $departure->{departure}) { % if (my $e = $details->{route}{postEnd}) { Zug wird voraussichtlich in <%= $e %> abgestellt.<br/><br/> % } % if ($details->{cycle}{to}) { % if (@{$departure->{cycle_to} // []}) { Weiterfahrt möglicherweise als <ul> % for my $train_no (sort {$a <=> $b} @{ $details->{cycle}{to} // [] }) { % my $train = app->train_details_db->{$train_no}; % for my $t (@{$departure->{cycle_to}}) { % my ($train_no, $train) = @{$t}; % my $tt = $train->{type} // $train->{rawType} // 'Zug'; % $tt =~ s{ .*|[0-9]}{}; <li><%= $tt %> <%= $train_no %> Loading Loading
lib/DBInfoscreen/Controller/Stationboard.pm +17 −4 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ use DateTime; use DateTime::Format::Strptime; use Encode qw(decode encode); use File::Slurp qw(read_file write_file); use List::Util qw(max); use List::Util qw(max uniq); use List::MoreUtils qw(); use Mojo::JSON qw(decode_json); use Mojo::Promise; Loading Loading @@ -789,6 +789,20 @@ sub render_train { return; } )->wait; $departure->{composition} = $self->app->train_details_db->{ $departure->{train_no} }; my @cycle_from; my @cycle_to; for my $cycle ( values %{ $departure->{composition}->{cycle} // {} } ) { push( @cycle_from, @{ $cycle->{from} // [] } ); push( @cycle_to, @{ $cycle->{to} // [] } ); } @cycle_from = sort { $a <=> $b } uniq @cycle_from; @cycle_to = sort { $a <=> $b } uniq @cycle_to; $departure->{cycle_from} = [ map { [ $_, $self->app->train_details_db->{$_} ] } @cycle_from ]; $departure->{cycle_to} = [ map { [ $_, $self->app->train_details_db->{$_} ] } @cycle_to ]; } # Defer rendering until all requests have completed Loading @@ -799,8 +813,7 @@ sub render_train { departure => $departure, linetype => $linetype, icetype => $self->app->ice_type_map->{ $departure->{train_no} }, details => $self->app->train_details_db->{ $departure->{train_no} }, details => $departure->{composition} // {}, dt_now => DateTime->now( time_zone => 'Europe/Berlin' ), station_name => $station_name, nav_link => Loading
lib/DBInfoscreen/Helper/Wagonorder.pm +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ sub has_cycle_p { my ( $self, $train_no ) = @_; return $self->head_dbdb_p( "https://lib.finalrewind.org/dbdb/db_umlauf/${train_no}.png"); "https://lib.finalrewind.org/dbdb/db_umlauf/${train_no}.svg"); } sub check_wagonorder_p { Loading
share/zugbildungsplan.json +1 −1 File changed.Preview size limit exceeded, changes collapsed. Show changes
templates/_train_details.html.ep +10 −10 Original line number Diff line number Diff line Loading @@ -228,10 +228,10 @@ % } </ul> <!-- mroute --> % } % if (param('detailed') and $departure->{has_cycle}) { % if ($departure->{has_cycle}) { <div class="db-attr"><a href="https://lib.finalrewind.org/dbdb/db_umlauf/<%= $departure->{train_no} %>.svg">Umlaufplan</a></div> % } % if (param('detailed') and $details->{commonAttr}) { % if ($details->{commonAttr}) { % if ($details->{attrVariants} and (not $details->{commonAttr}{vmax} or not $details->{commonAttr}{brakingPercentage})) { <div class="db-attr"> Attribute: Loading @@ -248,15 +248,15 @@ </div> % } % } % if (param('detailed') and $details and not $departure->{arrival}) { % if ($details and not $departure->{arrival}) { % if (my $s = $details->{route}{preStart}) { Zug wird voraussichtlich aus <%= $s %> eingesetzt.<br/><br/> % } % if ($details->{cycle}{from}) { % if (@{$departure->{cycle_from} // []}) { Bildung möglicherweise aus <ul> % for my $train_no (sort {$a <=> $b} @{ $details->{cycle}{from} // [] }) { % my $train = app->train_details_db->{$train_no}; % for my $t (@{$departure->{cycle_from}}) { % my ($train_no, $train) = @{$t}; % my $tt = $train->{type} // $train->{rawType} // 'Zug'; % $tt =~ s{ .*|[0-9]}{}; <li><%= $tt %> <%= $train_no %> Loading @@ -268,15 +268,15 @@ </ul> % } % } % elsif (param('detailed') and $details and not $departure->{departure}) { % elsif ($details and not $departure->{departure}) { % if (my $e = $details->{route}{postEnd}) { Zug wird voraussichtlich in <%= $e %> abgestellt.<br/><br/> % } % if ($details->{cycle}{to}) { % if (@{$departure->{cycle_to} // []}) { Weiterfahrt möglicherweise als <ul> % for my $train_no (sort {$a <=> $b} @{ $details->{cycle}{to} // [] }) { % my $train = app->train_details_db->{$train_no}; % for my $t (@{$departure->{cycle_to}}) { % my ($train_no, $train) = @{$t}; % my $tt = $train->{type} // $train->{rawType} // 'Zug'; % $tt =~ s{ .*|[0-9]}{}; <li><%= $tt %> <%= $train_no %> Loading