diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-06-16 20:01:07 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-06-16 20:01:07 +0200 |
commit | 6ea954c9634912f499c2f1c2b3356d491e40f747 (patch) | |
tree | afec2e6ae5860e5797b66ad2e6123f58f775cd53 /lib/Travelynx.pm | |
parent | 68fcdf3d6ffc0253eb8f9f64631256fed3128549 (diff) |
show load/occupancy for EFA departures and trips, if available
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-x | lib/Travelynx.pm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 3d892ec..7c8dc19 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -447,6 +447,32 @@ sub startup { ); $self->helper( + 'efa_load_icon' => sub { + my ( $self, $occupancy ) = @_; + + my @symbols + = ( + qw(help_outline person_outline people priority_high not_interested) + ); + + if ( $occupancy eq 'MANY_SEATS' ) { + $occupancy = 1; + } + elsif ( $occupancy eq 'FEW_SEATS' ) { + $occupancy = 2; + } + elsif ( $occupancy eq 'STANDING_ONLY' ) { + $occupancy = 3; + } + elsif ( $occupancy eq 'FULL' ) { + $occupancy = 4; + } + + return $symbols[$occupancy] // 'help_outline'; + } + ); + + $self->helper( 'load_icon' => sub { my ( $self, $load ) = @_; my $first = $load->{FIRST} // 0; |