Skip to content

Commit

Permalink
Fix genre evaluation with some Perl versions?
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelherger committed Dec 14, 2024
1 parent ef12b9a commit d2c4a6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 0 additions & 2 deletions Slim/Schema.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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} ) {
Expand Down
13 changes: 6 additions & 7 deletions Slim/Schema/Genre.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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($_)}

This comment has been minimized.

Copy link
@darrell-k

darrell-k Dec 15, 2024

Contributor

What I was trying to do here was simply check that key uc($_) exists in the hash.

This comment has been minimized.

Copy link
@michaelherger

michaelherger Dec 15, 2024

Author Member

Ok, so we at least have the same expectation 😁. But IMHO that's still what my version should be doing. I'll double check again.

This comment has been minimized.

Copy link
@michaelherger

michaelherger Dec 15, 2024

Author Member

Oh, I think the problem is that we're uppercasing here, but don't do so when populating $myClassicalGenreMap.

This comment has been minimized.

Copy link
@michaelherger

michaelherger Dec 15, 2024

Author Member

N.m. - we do uppercase the pref value. Hmm...

}
return 0;

return grep {
$myClassicalGenreMap->{uc($_)}
} Slim::Music::Info::splitTag($genres, $sep) ? 1 : 0;
}

sub myClassicalGenreIds {
Expand Down

2 comments on commit d2c4a6a

@michaelherger
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darrell-k what was the old version supposed to do? Some installations failed on the %$myClasscialGenreMap{uc($_)}. The %$ or whatever.

@michaelherger
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed in c860f34

Please sign in to comment.