diff options
| author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-09-19 22:46:45 +0200 | 
|---|---|---|
| committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-09-19 22:52:56 +0200 | 
| commit | 7f4fff3a34f9f7fe519e98a79eb47120d57835b9 (patch) | |
| tree | 32da1955806ac27cfb76ff659b0afb3a78f1a1e5 /lib/Travelynx | |
| parent | 1121e43d8db647c7a93e9bbc1129bdaeab52cb11 (diff) | |
API: checkin: handle efa and motis checkins2.17.5
Closes #315
Diffstat (limited to 'lib/Travelynx')
| -rwxr-xr-x | lib/Travelynx/Controller/Api.pm | 14 | 
1 files changed, 8 insertions, 6 deletions
| diff --git a/lib/Travelynx/Controller/Api.pm b/lib/Travelynx/Controller/Api.pm index 572d3fa..fa40e76 100755 --- a/lib/Travelynx/Controller/Api.pm +++ b/lib/Travelynx/Controller/Api.pm @@ -188,10 +188,13 @@ sub travel_v1 {  		my $to_station   = sanitize( q{}, $payload->{toStation} );  		my $train_id;  		my $dbris = sanitize( undef, $payload->{dbris} ); +		my $efa   = sanitize( undef, $payload->{efa} );  		my $hafas = sanitize( undef, $payload->{hafas} );  		my $motis = sanitize( undef, $payload->{motis} ); -		if ( not $hafas and exists $payload->{train}{journeyID} ) { +		if ( not( $efa or $hafas or $motis ) +			and exists $payload->{train}{journeyID} ) +		{  			$dbris //= 'bahn.de';  		} @@ -216,8 +219,7 @@ sub travel_v1 {  			return;  		} -		if (    not $hafas -			and not $dbris +		if (    not( $dbris or $efa or $hafas or $motis )  			and not $self->stations->search( $from_station, backend_id => 1 ) )  		{  			$self->render( @@ -233,8 +235,7 @@ sub travel_v1 {  		}  		if (    $to_station -			and not $hafas -			and not $dbris +			and not( $dbris or $efa or $hafas or $motis )  			and not $self->stations->search( $to_station, backend_id => 1 ) )  		{  			$self->render( @@ -297,8 +298,9 @@ sub travel_v1 {  					station  => $from_station,  					train_id => $train_id,  					uid      => $uid, -					hafas    => $hafas,  					dbris    => $dbris, +					efa      => $efa, +					hafas    => $hafas,  					motis    => $motis,  				);  			} | 
