summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-04-19 17:40:39 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-04-19 17:40:39 +0200
commit5ce4bc6995da0b49783c15a66075e5e4f1545875 (patch)
treeaeea7da0654d49bf62f9ffb8ba0c2e75159b9087 /lib/Travelynx.pm
parenta3cfa598a6de9e053a5228be3ee5088ea0eabc18 (diff)
improve commute station heuristic
Select top station on work days (Mo .. Fr) with arrival < 13:00 or departure >= 13:00.
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm34
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 7e7d850..7495b76 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -2720,40 +2720,6 @@ sub startup {
);
$self->helper(
- 'get_top_destinations' => sub {
- my ( $self, %opt ) = @_;
- my $uid = $opt{uid} //= $self->current_user->{id};
- my $db = $opt{db} //= $self->pg->db;
-
- my @stations;
-
- my $res = $db->query(
- qq{
- select arr_eva, count(arr_eva) as count
- from journeys_str
- where user_id = ?
- and real_dep_ts between ? and ?
- group by arr_eva
- order by count desc
- limit 5
- }, $uid, $opt{after}->epoch, $opt{before}->epoch
- );
-
- for my $dest ( $res->hashes->each ) {
- $self->app->log->debug( $dest->{arr_eva} );
- $self->app->log->debug( $dest->{count} );
- if ( my $station
- = $self->app->station_by_eva->{ $dest->{arr_eva} } )
- {
- push( @stations, $station );
- }
- }
-
- return @stations;
- }
- );
-
- $self->helper(
'get_connection_targets' => sub {
my ( $self, %opt ) = @_;