Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    Jul 2010
    Location
    Oz
    Posts
    282

    VL browse menus only show first 50 items

    Hello.

    I'm trying to create browse menus for a couple of virtual libraries.
    These browse menus should be located inside a (home menu) parent folder. Works except there's something wrong with my url or so. I can only get it these sub menus to show the first 50 items (index=0) but never more (like index=100).

    If I put the browse menu definitions (my $pt + push @browseMenus inside the feed) there's no problem. But since I need many menus for a couple of different libraries I thought I'd gather the definitions first and then register the parent folder node with the (sub) menus at the end. But then I get only the first page (50 items, index=0)...

    Here the sub for an example VL and a browse menu:

    Code:
    initVLs {
    	my $library = {
        	id => 'MYCUSTOMMENUS_VLID_SOMECOMMENT',
        	name => 'VL for comment menu',
         	sql => qq{
        		INSERT OR IGNORE INTO library_track (library, track)
        		SELECT '%s', tracks.id FROM tracks
    			LEFT JOIN comments comments ON comments.track = tracks.id
    			WHERE
    				comments.value LIKE '%%somecomment%%' AND
    				tracks.audio = 1
    			GROUP by tracks.id
    		},
    	};
    	Slim::Music::VirtualLibraries->unregisterLibrary($library);
    	Slim::Music::VirtualLibraries->registerLibrary($library);
    	Slim::Music::VirtualLibraries->rebuild($library->{id});
    
    	my @browseMenus = ();
    
    	my $pt = {library_id => Slim::Music::VirtualLibraries->getRealId($library->{id})};
    	push @browseMenus,{
    		type => 'link',
    		name => 'Some Comment - Tracks',
    		url => \&Slim::Menu::BrowseLibrary::_tracks,
    		icon => 'html/images/playlists.png',
    		jiveIcon => 'html/images/playlists.png',
    		id => 'MYCUSTOMMENUS_SOMECOMMENT',
    		condition => \&Slim::Menu::BrowseLibrary::isEnabledNode,
    		weight => 220,
    		cache => 1,
    		passthrough => [{
    			library_id => $pt->{'library_id'},
    			searchTags => [
    				'library_id:'.$pt->{'library_id'}
    			],
    		}],
    	};
    
    	Slim::Menu::BrowseLibrary->deregisterNode('mycustommenus');
    	Slim::Menu::BrowseLibrary->registerNode({
    		type         => 'link',
    		name         => 'HOME_MENU_PARENTFOLDER_NAME',
    		id           => 'mycustommenus',
    		feed         => sub {
    			my ($client, $cb, $args,$pt) = @_;
    			$cb->({
    				items => \@browseMenus,
    			});
    		},
    		icon => 'plugins/MyCustomMenus/html/images/icon.png',
    		jiveIcon => 'plugins/MyCustomMenus/html/images/icon.png',
    		weight       => 89,
    		cache        => 1,
    	});
    }
    Any idea how to fix this? Thank you.

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,586

    VL browse menus only show first 50 items

    > I'm trying to create browse menus for a couple of virtual libraries.
    > These browse menus should be located inside a (home menu) parent folder.
    > Works except there's something wrong with my url or so. I can only get
    > it these sub menus to show the first 50 items (index=0) but never more
    > (like index=100).


    I'm not sure what exactly is missing. But what I've done in the past is
    not use Slim::Menu::BrowseLibrary::_tracks directly as the callback, but
    implement my own, which in turn would call that method to get the data.

    See eg.
    https://github.com/Logitech/slimserv...Plugin.pm#L248

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •