From de074342de0bdc3604a0610a0c5f9cce5338bb85 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 24 Sep 2023 18:19:17 +0200 Subject: add support for HAFAS connection suggestions; drop manual destination list Still TODO: handle stations that have several EVAs --- lib/Travelynx/Model/Users.pm | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'lib/Travelynx/Model/Users.pm') diff --git a/lib/Travelynx/Model/Users.pm b/lib/Travelynx/Model/Users.pm index 4b108d4..4602fa2 100644 --- a/lib/Travelynx/Model/Users.pm +++ b/lib/Travelynx/Model/Users.pm @@ -567,7 +567,6 @@ sub delete { $res{transit} = $db->delete( 'in_transit', { user_id => $uid } ); $res{hooks} = $db->delete( 'webhooks', { user_id => $uid } ); $res{trwl} = $db->delete( 'traewelling', { user_id => $uid } ); - $res{lt} = $db->delete( 'localtransit', { user_id => $uid } ); $res{password} = $db->delete( 'pending_passwords', { user_id => $uid } ); $res{relations} = $db->delete( 'relations', [ { subject_id => $uid }, { object_id => $uid } ] ); @@ -651,34 +650,12 @@ sub use_history { my $uid = $opt{uid}; my $value = $opt{set}; - if ( $opt{destinations} ) { - $db->insert( - 'localtransit', - { - user_id => $uid, - data => - JSON->new->encode( { destinations => $opt{destinations} } ) - }, - { on_conflict => \'(user_id) do update set data = EXCLUDED.data' } - ); - } - if ($value) { $db->update( 'users', { use_history => $value }, { id => $uid } ); } else { - if ( $opt{with_local_transit} ) { - my $res = $db->select( - 'user_transit', - [ 'use_history', 'data' ], - { id => $uid } - )->expand->hash; - return ( $res->{use_history}, $res->{data}{destinations} // [] ); - } - else { - return $db->select( 'users', ['use_history'], { id => $uid } ) - ->hash->{use_history}; - } + return $db->select( 'users', ['use_history'], { id => $uid } ) + ->hash->{use_history}; } } -- cgit v1.2.3