summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-07-05 08:08:57 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2025-07-05 08:08:57 +0200
commite78ec690456df67d775a1d93e6c232055c327fa8 (patch)
treec6edcd2a5fd35ec89f142fb636714e7b924f547f /lib/Travel
parentbdfd939b0816f48d3934bf3b04acd8b51963486b (diff)
Group->parse_model: extend single-carriage special case to BR 640, 650
See https://github.com/derf/travelynx/issues/270
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/DBRIS/Formation/Group.pm13
1 files changed, 10 insertions, 3 deletions
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;