Bug 17430 - On initial start after a clean installation, Music Browse menus would not be initialized
: On initial start after a clean installation, Music Browse menus would not be ...
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 7.6.0
: PC All
: -- normal (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-10 08:14 UTC by Michael Herger
Modified: 2011-08-15 06:35 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments
add "schema initialized" notification to delay browse mode init if needed (3.04 KB, patch)
2011-08-10 23:41 UTC, Michael Herger
Details | Diff
always add menu items, but show placeholder if not ready (2.53 KB, patch)
2011-08-15 06:08 UTC, Michael Herger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Herger 2011-08-10 08:14:05 UTC
slimerver.pl is checking for an existing library, or it wouldn't load the menus:

if (Slim::Schema::hasLibrary()) {
	main::INFOLOG && $log->info("Library Browser init...");
	require Slim::Menu::BrowseLibrary;
	Slim::Menu::BrowseLibrary->init();
}

On an initial start, where no prefs nor db exist, this condition might not be met. But there's no code to initialize the browse menus at a later stage.
Comment 1 Michael Herger 2011-08-10 12:28:03 UTC
I see three options to fix this - with different ugliness:

- check whether the BrowseMenu has been initialized whenever a menu needs to be displayed, run init() if not

- hard-code a call to BrowseMenu->init() in Schema->init()

- add a "schema init done" notification to which BrowseMenu would subscribe
Comment 2 Michael Herger 2011-08-10 23:41:21 UTC
Created attachment 7387 [details]
add "schema initialized" notification to delay browse mode init if needed

Alan - I was wondering why we didn't initialize browse modes without schema. Couldn't we just check this before entering a menu instead? After all those browse modes should always be available, shouldn't they?

This patch would delay the initialization if the schema wasn't ready yet.
Comment 3 Michael Herger 2011-08-10 23:45:02 UTC
One more thing: I wasn't able to reproduce this issue on my MacBook. But I did see it in a FreeNAS/SlimNAS VM, and saw reports about it for a QNAP user (forgot the others). I was wondering whether this was a timing issue which could be worked around by re-ordering the calls?
Comment 4 Michael Herger 2011-08-11 09:48:02 UTC
From the forums: 

"Both my systems are Linux based (Vortexbox and a Linkstation NAS). Using both machines, the 33033 versions seem to function properly with one limitation: When starting from no pre-existing database, I had to restart SBS after the first scan in order to be able browse my library."

"I consider this machine pretty decently spec'd for SBS usage (scans 8000 Flac tracks in 3 minutes). Is is a Vortexbox distro on bare metal, with a dual core D510 at 1.66GHz."

http://forums.slimdevices.com/showpost.php?p=648974&postcount=101
Comment 5 Michael Herger 2011-08-15 06:08:35 UTC
Created attachment 7396 [details]
always add menu items, but show placeholder if not ready

This is a simpler approach: always initialize the full menu, but show a placeholder if the user is browsing a menu before the schema is fully initialized.
Comment 6 SVN Bot 2011-08-15 06:32:57 UTC
 == Auto-comment from SVN commit #33094 to the slim repo by mherger ==
 == http://svn.slimdevices.com/slim?view=revision&revision=33094 ==

Fixed Bug: 17430
Description: initialize BrowseLibrary even if schema is not ready yet. Menu items are hidden anyway until the schame is fully initialized. Add some fall back message in case a user managed to browse a link before it was ready (eg. from a stale web page)