From 1ca70b38ed92aaf1a52418ee91bd2d194a556baf Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 19 Jan 2025 20:14:41 +0100 Subject: Add support for up to two stopovers --- lib/Travel/Routing/DE/DBRIS.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib') diff --git a/lib/Travel/Routing/DE/DBRIS.pm b/lib/Travel/Routing/DE/DBRIS.pm index 63f6d35..6f57dcf 100644 --- a/lib/Travel/Routing/DE/DBRIS.pm +++ b/lib/Travel/Routing/DE/DBRIS.pm @@ -86,6 +86,14 @@ sub new { deutschlandTicketVorhanden => \0 }; + for my $via ( @{ $conf{via} } ) { + my $via_stop = { id => $via->{stop}->id }; + if ( $via->{duration} ) { + $via_stop->{aufenthaltsdauer} = 0 + $via->{duration}; + } + push( @{ $req->{zwischenhalte} }, $via_stop ); + } + if ( @{ $conf{discounts} // [] } ) { $req->{reisende}[0]{ermaessigungen} = []; } @@ -346,6 +354,13 @@ the requested itinerary. A Travel::Status::DE::DBRIS::Location(3pm) instance describing the destination of the requested itinerary. +=item B => I + +An arrayref containing up to two hashrefs that describe stopovers which must +be part of the requested itinerary. Each hashref consists of two keys: +B (Travel::Status::DE::DBRIS::Location(3pm) object, mandatory) and +B (stopover duration in minutes, optional, default: 0). + =item B => I A Cache::File(3pm) instance used for caching bahn.de requests. -- cgit v1.2.3