summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-01-29 18:48:58 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2020-01-29 18:48:58 +0100
commit993f6be6c9524031d878f2c83dcba1fdde11d060 (patch)
treef0d76b331a5a0e8092c68dab4e9de3d67cabbdf3 /lib/Travelynx.pm
parent6b1aa9cd3905ac18ef0c21bea37d638fc48ef17d (diff)
map: set bounds on stations; move polyline feature to staging1.14.1
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 8e21f16..f44bb8a 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -2785,6 +2785,10 @@ sub startup {
# Otherwise, we grab a fresh one.
my $db = $opt{db} // $self->pg->db;
+ my @select
+ = (
+ qw(journey_id train_type train_line train_no checkin_ts sched_dep_ts real_dep_ts dep_eva checkout_ts sched_arr_ts real_arr_ts arr_eva edited route messages user_data)
+ );
my %where = (
user_id => $uid,
cancelled => 0
@@ -2812,9 +2816,13 @@ sub startup {
-between => [ $opt{after}->epoch, $opt{before}->epoch, ] };
}
+ if ( $opt{with_polyline} ) {
+ push( @select, 'polyline' );
+ }
+
my @travels;
- my $res = $db->select( 'journeys_str', '*', \%where, \%order );
+ my $res = $db->select( 'journeys_str', \@select, \%where, \%order );
for my $entry ( $res->expand->hashes->each ) {
@@ -2837,6 +2845,10 @@ sub startup {
user_data => $entry->{user_data},
};
+ if ( $opt{with_polyline} ) {
+ $ref->{polyline} = $entry->{polyline};
+ }
+
if ( my $station
= $self->app->station_by_eva->{ $ref->{from_eva} } )
{