volumio/Volumio-WebUI

Library just spins (Loading)

holiman opened this issue · 3 comments

When I go to the library view, it just spins (Loading). Howver, if I manually via the console call loadLibraryIfNeeded(), it loads just fine. I can't see that loadLibraryIfNeeded() is called from anywhere in the source code, and I don't know where it's intended to be called from.

root@volumio:/var/www# grep -r "loadLibraryIfNeeded" 
js/volumio.library.js:function loadLibraryIfNeeded() {

This likely is not the ideal solution, but adding the callback to the last line of the script volumio.library.js worked for me.
So the last end of the script looks like:
// Resize event
$(window).resize(function() {
decideViewLayout();
});
loadLibraryIfNeeded();
});

Thank you for reporting. But all development efforts are now focused on Volumio2:
https://github.com/volumio/Volumio2

In my humble opinion is should be placed at the point where the library is enabled.

// Tabs initialization
if (library.isEnabled) {
enableLibrary();
loadLibraryIfNeeded();
} else {
disableLibrary();
}

Seems logic to me, if the library is enabled within the settings menu the library has to be loaded.
If not enabled don't bother.

Possibly it should even be the final part of the 'enableLibrary();' function.