Skip to content

Commit

Permalink
Merge pull request #1044 from darrell-k/menu-condition
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelherger committed Apr 6, 2024
2 parents 96f72ad + 3bd9ed6 commit 0267a9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Slim/Menu/BrowseLibrary.pm
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,11 @@ sub _registerBaseNodes {
feed => \&_works,
icon => 'html/images/playlists.png',
homeMenuText => 'BROWSE_WORKS',
condition => \&isEnabledNode,
condition => sub {
return unless isEnabledNode(@_);
my $totals = Slim::Schema->totals($_[0]);
return $totals->{work} if $totals;
},
id => 'myMusicWorks',
weight => 35,
cache => 1,
Expand Down
1 change: 1 addition & 0 deletions Slim/Schema.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3222,6 +3222,7 @@ sub totals {
genre => ['genres', 0, 1, 'tags:CC'],
track => ['titles', 0, 1, 'tags:CC'],
playlist => ['playlists', 0, 1, 'tags:CC'],
work => ['works', 0, 1, 'tags:CC'],
);

while (my ($key, $query) = each %categories) {
Expand Down

0 comments on commit 0267a9d

Please sign in to comment.