Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Senior Member
    Join Date
    Sep 2005
    Posts
    2,637
    Quote Originally Posted by afriend View Post
    One oddity: in the artists menu for this virtual ibrary, some artists have - in addition to the correct albums - empty albums listed (when you click on them, it says empty). That happens also if I create such a library with the advanced search UI. Any idea how to get rid of those?
    please check these artists for "member of a sampler/compilation"
    Do you use one or two lists? -> settings/my music / browse artists
    I believe your using two - try one and these emptry artists are gone.

  2. #12
    Quote Originally Posted by DJanGo View Post
    please check these artists for "member of a sampler/compilation"
    Do you use one or two lists? -> settings/my music / browse artists
    I believe your using two - try one and these emptry artists are gone.
    I think you are right. I haven't checked all of the empty album entries but they seem to be compilations that do include a song by the chosen artist but just not one with AAA in the comments tag.

    As for the LMS settings, I don't know what configurable in "single, configurable artists list" means but I've always had only one single list for artists and album artists alike. I have toggled between the 2 available settings but that doesn't make the "ghost" albums disappear.
    I'll probably table this for now so I don't get distracted from the virtual library tasks. I might require a separate thread.
    Last edited by afriend; 2018-08-14 at 03:40.

  3. #13
    #1
    Ok, so I have almost finished creating the virtual libraries I need.
    For the "20 Random Compilation Albums" (= built-in "20 Random Albums" for compilations) I could only come up with a workaround.
    I've tried creating a virtual library for that but couldn't figure out the exact SQL query (using albums.id or what not) to get it working, however many SQL query variations I tried. The only code that worked gave me 20 random compilation albums with just 1 track in it = 20 random tracks.
    I know it's because it's on the track and not album level but just couldn't fugure it out.
    And - it didn't rebuild the menu when clicking on it again.

    Code:
         	sql => qq{
    				INSERT OR IGNORE INTO library_track (library, track)
    					SELECT '%s', tracks.id
    					FROM tracks 
    					JOIN albums ON tracks.album = albums.id 
    					WHERE albums.compilation=1
    					AND tracks.audio = 1
    					AND not exists(select * from genre_track,genres 
    						where
    							genre_track.track=tracks.id and
    							genre_track.genre=genres.id and
    							genres.name in ('Classical','Soundtracks'))
    			
    				group by albums.id
    				order by random()
    				
    				limit 20
         				},
       		rebuildOnSelect => 1
    Anyway, so I tried this workaround: I used the virtual library that gives me all compilation albums and I added mode => 'randomalbums' and sort => 'random' to the code that creates the menu:

    Code:
    		Slim::Menu::BrowseLibrary->registerNode({
    			type         => 'link',
    			name         => 'COMPILATIONS_RANDOM_20_ALBUMS',
    			params       =>  {library_id => Slim::Music::VirtualLibraries->getRealId('COMPIS_with_EXCLUDED_GENRES'),
    								mode => 'randomalbums',
    								sort => 'random'},
    			feed         => \&Slim::Menu::BrowseLibrary::_albums,
    			icon         => 'html/images/albums.png',
    			jiveIcon     => 'html/images/albums.png',
    			homeMenuText => 'COMPILATIONS_RANDOM_20_ALBUMS',
    			condition    => \&Slim::Menu::BrowseLibrary::isEnabledNode,
    			id           => 'COMPILATIONS_RANDOM_20_TracksByAlbum',
    			weight       => 90,
    			cache        => 1,
    			});
    I'd be ok with this workaround but it always gives me 50 albums.
    Is there a way to insert a limit (20 albums) into this workaround?

    #2
    But now comes the really hard part: with all those menus on the top level it's getting more and more crowded. And while I can play around and do some trial and error with SQL, there's no way I can do the same with perl.
    I took a look at the code of some plugins, especially Erland's Custom Libraries which has a part in it that makes all menus (artists, albums...) of a virtual library submenus of a top level menu with the name of the virtual library. But that menu grouping code is so beyond what I can do. I just couldn't get it to work.

    So if you know how to group menus together the way I described in the opening post, if you have some working code that I can easily adjust to my needs, I would be very glad to see it here.
    From my many hours of tinkering with virtual libraries, I can say it's not easy but ultimately rewarding because it allows finer control and will hopefully still work by the time Erland's plugins will have stopped working. Thank you very much for your help.

  4. #14
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,103

    Virtual Libraries - help beginner please

    > *And* - *it didn't rebuild the menu when clicking on it* again.

    There's no mechanism to achieve this.

    > rebuildOnSelect => 1


    That flag you must have invented yourself. Or I'm victim of my
    forgetfulness again... I didn't find it in all of the LMS code base.

    > Anyway, so I tried *this workaround*: I used the virtual library that
    > gives me all compilation albums and I added *mode => 'randomalbums'* and
    > *sort => 'random'* to -the code that creates the menu:-


    You're definitely exploring new ground here! :-) Great, if that works!

    But the 'order by...' is irrelevant in the insert. It's only relevant
    when querying data.

    > I'd be ok with this workaround but it always gives me *50* albums.
    > Is there a way to insert a limit (*20* albums) into this workaround?


    I guess that's just the default number of items per page.

    --

    Michael

  5. #15
    So I gave up on the idea of having a menu group for the menu I've created. It's too difficult for me. If somebody digs up this thread at some time and get this working, please post your code here.

    One final (I hope) question regarding the genre menu I've created for compilations.
    The menu levels are like this:

    Compis by Genre (Top Level Name) > genres (where you select a genre) > artists (it shows you all artists in this genre, you select all albums) > all albums

    How can I eliminate the artists menu level and make it go straight from genres to all albums from this genre?
    Last edited by afriend; 2018-08-22 at 06:23.

  6. #16
    Uh, and I'd like to include my own icons in the plugin 'bundle' for Web UI and iPeng:
    what's the correct path to use in the menu parameters?

    icon => '???????????.png'

Posting Permissions

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