From e500c2e537703f13b7af75cdc45d403314c8190f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 26 Apr 2019 22:12:34 +0200 Subject: work: Update route and messages --- lib/Travelynx/Command/work.pm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'lib/Travelynx/Command') diff --git a/lib/Travelynx/Command/work.pm b/lib/Travelynx/Command/work.pm index b8f8e52..c43f920 100644 --- a/lib/Travelynx/Command/work.pm +++ b/lib/Travelynx/Command/work.pm @@ -44,8 +44,18 @@ sub run { $db->update( 'in_transit', - { real_departure => $train->departure }, - { user_id => $uid } + { + real_departure => $train->departure, + route => join( '|', $train->route ), + messages => join( + '|', + map { + ( $_->[0] ? $_->[0]->epoch : q{} ) . ':' + . $_->[1] + } $train->messages + ) + }, + { user_id => $uid } ); } }; @@ -78,6 +88,14 @@ sub run { { sched_arrival => $train->sched_arrival, real_arrival => $train->arrival, + route => join( '|', $train->route ), + messages => join( + '|', + map { + ( $_->[0] ? $_->[0]->epoch : q{} ) . ':' + . $_->[1] + } $train->messages + ) }, { user_id => $uid } ); -- cgit v1.2.3