Skip to content
GitLab
Explore
Sign in
derf
db-infoscreen
Compare revisions
3e922f517cbebc1aa8ab60081a9977e8a684866b to 7b245833632b10ef08848833fc6c2934682f0c19
Commits on Source (2)
train detail title: show line if number is unavailable
· a62ab624
Birte Kristina Friesel
authored
Apr 12, 2024
a62ab624
partially work around Travel::Status::DE::HAFAS mis-detecting ÖBB station names
· 7b245833
Birte Kristina Friesel
authored
Apr 12, 2024
7b245833
Hide whitespace changes
Inline
Side-by-side
lib/DBInfoscreen/Controller/Stationboard.pm
View file @
7b245833
...
...
@@ -518,7 +518,14 @@ sub handle_request {
(
$status
->
station
?
$status
->
station
->
{
name
}
:
$station
),
};
if
(
$status
->
station
and
$status
->
station
->
{
names
}
)
{
# Travel::Status::DE::HAFAS mis-detects ÖBB station names
if
(
$hafas
and
$hafas
eq
'
ÖBB
'
and
@
{
$status
->
station
->
{
names
}
//
[]
}
>
1
)
{
$data
->
{
station_name
}
=
$station
;
}
elsif
(
$status
->
station
and
$status
->
station
->
{
names
}
)
{
$data
->
{
station_name
}
=
List::Util::
reduce
{
length
(
$a
)
<
length
(
$b
)
?
$a
:
$b
}
@
{
$status
->
station
->
{
names
}
};
...
...
@@ -1180,7 +1187,8 @@ sub train_details {
my
$train_type
=
$res
->
{
train_type
}
=
$journey
->
type
//
q{}
;
my
$train_no
=
$res
->
{
train_no
}
=
$journey
->
number
//
q{}
;
$res
->
{
train_line
}
=
$journey
->
line_no
//
q{}
;
$self
->
stash
(
title
=>
"
${train_type}
${train_no}
"
);
$self
->
stash
(
title
=>
$train_type
.
'
'
.
(
$train_no
||
$res
->
{
train_line
}
)
);
}
if
(
not
defined
$journey
->
class
)
{
...
...