From e78ec690456df67d775a1d93e6c232055c327fa8 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 5 Jul 2025 08:08:57 +0200 Subject: Group->parse_model: extend single-carriage special case to BR 640, 650 See https://github.com/derf/travelynx/issues/270 --- lib/Travel/Status/DE/DBRIS/Formation/Group.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/Travel/Status/DE/DBRIS/Formation') diff --git a/lib/Travel/Status/DE/DBRIS/Formation/Group.pm b/lib/Travel/Status/DE/DBRIS/Formation/Group.pm index f03602a..b6cae8a 100644 --- a/lib/Travel/Status/DE/DBRIS/Formation/Group.pm +++ b/lib/Travel/Status/DE/DBRIS/Formation/Group.pm @@ -636,12 +636,19 @@ sub parse_model { my @likelihood = reverse sort { $ml{$a} <=> $ml{$b} } keys %ml; # Less than two carriages are generally inconclusive. - # Exception: BR 631 (Link I) only has a single carriage + # Exceptions: BR 631 (Link I), 640 (LINT 27, 650 (RS1) + # only have a single carriage if ( $ml{ $likelihood[0] } < 2 - and not($likelihood[0] eq '631' + and not( + ( + $likelihood[0] eq '631' + or $likelihood[0] eq '640' + or $likelihood[0] eq '650' + ) and @carriages == 1 - and substr( $carriages[0]->uic_id, 0, 2 ) eq '95' ) + and substr( $carriages[0]->uic_id, 0, 2 ) eq '95' + ) ) { $self->{subtype} = undef; -- cgit v1.2.3