From d2c4a6ab017dea23b5b7d9abad79aa1cf1d7a9af Mon Sep 17 00:00:00 2001 From: Michael Herger Date: Sat, 14 Dec 2024 16:20:13 +0100 Subject: [PATCH] Fix genre evaluation with some Perl versions? --- Slim/Schema.pm | 2 -- Slim/Schema/Genre.pm | 13 ++++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Slim/Schema.pm b/Slim/Schema.pm index 8315d17398..7e086412c0 100644 --- a/Slim/Schema.pm +++ b/Slim/Schema.pm @@ -1764,8 +1764,6 @@ sub _newTrack { if ( _workRequired($deferredAttributes->{'GENRE'}) ) { $workID = $self->_createWork($deferredAttributes->{'WORK'}, $deferredAttributes->{'WORKSORT'}, $contributors->{'COMPOSER'}->[0], 1); } - else { - } ### Find artwork column values for the Track if ( !$columnValueHash{cover} && $columnValueHash{audio} ) { diff --git a/Slim/Schema/Genre.pm b/Slim/Schema/Genre.pm index ff42fc4f3c..86a837e6ec 100644 --- a/Slim/Schema/Genre.pm +++ b/Slim/Schema/Genre.pm @@ -58,14 +58,13 @@ sub loadMyClassicalGenreMap { } sub isMyClassicalGenre { + my ($class, $genres, $sep) = @_; + loadMyClassicalGenreMap() if !$myClassicalGenreMap; - my $class = shift; - my $genres = shift; - my $sep = shift; - foreach ( Slim::Music::Info::splitTag($genres, $sep) ) { - return 1 if %$myClassicalGenreMap{uc($_)} - } - return 0; + + return grep { + $myClassicalGenreMap->{uc($_)} + } Slim::Music::Info::splitTag($genres, $sep) ? 1 : 0; } sub myClassicalGenreIds {