summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Command
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-08-06 16:04:12 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-08-06 16:04:12 +0200
commit717cc18a403d6705c64a9a6fd43578c1efbb159f (patch)
treed5e1ab56c42b85a0fa37f73c403f2eb177213701 /lib/Travelynx/Command
parentadaf65dc634b68e0890899e93bed62f0bbcb548a (diff)
Move get_departures to a separate IRIS helper
Diffstat (limited to 'lib/Travelynx/Command')
-rw-r--r--lib/Travelynx/Command/work.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Travelynx/Command/work.pm b/lib/Travelynx/Command/work.pm
index 727a694..9c870d8 100644
--- a/lib/Travelynx/Command/work.pm
+++ b/lib/Travelynx/Command/work.pm
@@ -35,7 +35,11 @@ sub run {
eval {
if ( $now->epoch - $entry->{real_dep_ts} < 900 ) {
- my $status = $self->app->get_departures( $dep, 30, 30 );
+ my $status = $self->app->iris->get_departures(
+ station => $dep,
+ lookbehind => 30,
+ lookahead => 30
+ );
if ( $status->{errstr} ) {
die("get_departures($dep): $status->{errstr}\n");
}
@@ -123,7 +127,11 @@ sub run {
or $now->epoch - $entry->{real_arr_ts} < 600 )
)
{
- my $status = $self->app->get_departures( $arr, 20, 220 );
+ my $status = $self->app->iris->get_departures(
+ station => $arr,
+ lookbehind => 20,
+ lookahead => 220
+ );
if ( $status->{errstr} ) {
die("get_departures($arr): $status->{errstr}\n");
}