Anyone who’s got 1k+ songs on their device will have noticed that the library gets rather sluggish when loading. This is not due to Volumio itself being slow, rather it’s a direct result of creating 1k+
So, once you’ve got your device setup and your music loaded, access the directory /var/www/js (if you’re on a windows box, I would recommend that you map the entire www directory; that way you’ll be able to edit css and html files as well). Then open up the file player_lib.js and make the following 2 alterations: (Pro-tip: if you’re having trouble finding these parts of the code, just press ctrl+f in most editors and start typing in the code verbatim)
- Somewhere around line 616, in the function var renderArtists = function() {, you’ll find a call for the next function renderAlbums();, go ahead and comment this line out using // . It should look like this:
var renderArtists = function() {
var output = '';
for (var i = 0; i < allArtists.length; i++) {
output += '<li class="clearfix"><div class="lib-entry'
+ (filters.artists.indexOf(allArtists[i]) >= 0 ? ' active' : '')
+ '">' + allArtists[i] + '</div></li>';
}
$('#artistsList').html(output);
//renderAlbums();
}
2.A few lines down, around 672, in the event handler $(’#artistsList’).on(‘click’, ‘.lib-entry’, function(e) { you’ll find the line clickedLibItem(e, pos == 0 ? undefined : allArtists[pos], filters.artists, renderArtists);. Here, you want to change the last bit to say renderAlbums instead of renderArtists. Or as I like to do, copy the line, make the change, and comment out the original… as such:
// click on ARTIST
$('#artistsList').on('click', '.lib-entry', function(e) {
var pos = $('#artistsList .lib-entry').index(this);
clickedLibItem(e, pos == 0 ? undefined : allArtists[pos], filters.artists, renderAlbums);
//clickedLibItem(e, pos == 0 ? undefined : allArtists[pos], filters.artists, renderArtists);
});
And you’re done!
Basically what you’ve done is prevent the albums and songs from being loaded until you actually click on an artist! Try it and be amazed at the performance increase and if you don’t like it, just change those two little bits back and you’re back to normal, no harm no foul!