diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-04-26 22:12:34 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-04-26 22:12:34 +0200 |
commit | e500c2e537703f13b7af75cdc45d403314c8190f (patch) | |
tree | bf4e84cdb1e5dc1269d9c8f08344b631f505ca3f /lib/Travelynx/Command/work.pm | |
parent | a760274c7c20570cf6380fc58682f649456a1268 (diff) |
work: Update route and messages
Diffstat (limited to 'lib/Travelynx/Command/work.pm')
-rw-r--r-- | lib/Travelynx/Command/work.pm | 22 |
1 files changed, 20 insertions, 2 deletions
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 } ); |