Unverified Commit bb9a1bf6 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Remove VRN; switch default backend to ÖBB

parent 4b5395ef
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -507,7 +507,7 @@ sub route {
		return $self->route_efa;
	}

	my $service = 'VRN';
	my $service = 'ÖBB';
	if (    $hafas
		and $hafas ne '1'
		and Travel::Status::DE::HAFAS::get_service($hafas) )
@@ -784,7 +784,7 @@ sub ajax_route {
	my $line_no = $self->stash('lineno');
	my $hafas   = $self->param('hafas');

	my $service = 'VRN';
	my $service = 'ÖBB';
	if (    $hafas
		and $hafas ne '1'
		and Travel::Status::DE::HAFAS::get_service($hafas) )
+8 −3
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ sub handle_no_results {
	}
	elsif ($hafas) {
		$self->render_later;
		my $service = 'VRN';
		my $service = 'ÖBB';
		if ( $hafas ne '1' and Travel::Status::DE::HAFAS::get_service($hafas) )
		{
			$service = $hafas;
@@ -433,7 +433,7 @@ sub get_results_p {
		);
	}
	if ( $opt{hafas} ) {
		my $service = 'VRN';
		my $service = 'ÖBB';
		if ( $opt{hafas} ne '1'
			and Travel::Status::DE::HAFAS::get_service( $opt{hafas} ) )
		{
@@ -2734,7 +2734,7 @@ sub stations_by_coordinates {
		return;
	}

	my $service = 'VRN';
	my $service = 'ÖBB';
	if (    $hafas
		and $hafas ne '1'
		and Travel::Status::DE::HAFAS::get_service($hafas) )
@@ -2908,6 +2908,11 @@ sub backend_list {
			# (I bet it's actually Permanently Unavailable)
			next;
		}
		if ( $backend->{shortname} eq 'VRN' ) {

			# HTTP 403 Forbidden as of 2025-03-03
			next;
		}
		push(
			@backends,
			{
+5 −4
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ package DBInfoscreen::Helper::HAFAS;
use strict;
use warnings;
use 5.020;
use utf8;

use DateTime;
use Encode qw(decode encode);
@@ -58,7 +59,7 @@ sub get_route_p {

	if ( $opt{trip_id} ) {
		$hafas_promise = Travel::Status::DE::HAFAS->new_p(
			service => $opt{service} // 'VRN',
			service => $opt{service} // 'ÖBB',
			journey => {
				id => $opt{trip_id},
			},
@@ -77,7 +78,7 @@ sub get_route_p {
	}

	$hafas_promise //= Travel::Status::DE::HAFAS->new_p(
		service      => $opt{service} // 'VRN',
		service      => $opt{service} // 'ÖBB',
		journeyMatch => $opt{train_req} =~ s{^- }{}r,
		datetime     => ( $opt{train} ? $opt{train}->start : $opt{datetime} ),
		language     => $opt{language},
@@ -108,7 +109,7 @@ sub get_route_p {
			}

			return Travel::Status::DE::HAFAS->new_p(
				service => $opt{service} // 'VRN',
				service => $opt{service} // 'ÖBB',
				journey => {
					id => $result->id,
				},
@@ -274,7 +275,7 @@ sub get_polyline_p {

	my $trip_id = $opt{id};
	my $line    = $opt{line};
	my $service = $opt{service} // 'VRN';
	my $service = $opt{service} // 'ÖBB';
	my $promise = Mojo::Promise->new;

	my $agent = $self->{user_agent};