Enabling, disabling the Library


If anyone wants to try and give me feedback about the Library (which can now be enabled or disabled in settings, and comes with some bugs fixes, faster loading) please let me know. There’s just some code to checkout on github and an update script to run.


I would like to help, I have been waiting for a working library tab.
But, I need some instructions and details about checking out from github, and where they need to be before running the script.

Which packages do I need for github?
I’m running kubutu (no windows in house).


If you’ve never used github, you may have to create an account and register the ssh key (not sure about that), it must be explained on github site.
My repo is there (forked from Volumio) : github.com/jotak/Volumio-WebUI/tree/act_library

If you want to test, what I suggest is directly checking out from your volumio installation:

  • install git if not already done (maybe it’s already installed): “apt-get install git”
  • move the current webui to another folder, for instance “mv /var/www /var/www-orig”
  • “mkdir /var/www”
  • checkout from git: “git clone git@github.com:jotak/Volumio-WebUI.git /var/www”
  • switch to my library branch: “cd /var/www” then “git checkout -b act_library”

That’s it for the git part.

Then you’ll have to run the update script:

  • cd /var/www/updates
  • update.py
    (make sure there isn’t any error here… since it’s still an experimental update script that I wrote to be able to manage the volumio database changes more efficiently, if you see any error here please tell me)

Then restart the web server :

  • sudo /etc/init.d/php-fpm restart (not sure for the exact name, I think it’s php-fpm… php-something for sure)

And you’re done. If the volumio ui doesn’t display well you may have to clear you browser cache. Tell me if anything went wrong.
You can see in the settings a new switch on/off for the library tab

Of course you can still retrieve the original webUI by moving back /var/www-orig to /var/www, and restarting the web server.

I forgot to say, when you checkout files from git you will loose all your volumio settings since they’re in a DB file located in /var/www/db ; but you’ll retrieve them when you put the original files back, don’t worry about that ; you only must make sure to keep the old files somewhere.

The MPD scanned musics, however, will still be there ; MPD has its own database.


I made it to the checkout (had top create an account and generate+add a public key to my github account)
But I don’t get the /updates directory, see list below.


Ps. Next time I’ll ssh as volumio, root was overkill DS

drwxr-xr-x 2 root root 4096 Sep 10 19:12 command
-rw-r–r-- 1 root root 1287 Sep 10 19:12 credits.php
drwxr-xr-x 2 root root 4096 Sep 10 19:12 css
drwxr-xr-x 2 root root 4096 Sep 10 19:12 db
-rw-r–r-- 1 root root 17020 Sep 10 19:12 dev.php
drwxr-xr-x 2 root root 4096 Sep 10 19:12 fonts
-rw-r–r-- 1 root root 3065 Sep 10 19:12 _footer.php
-rw-r–r-- 1 root root 5460 Sep 10 19:12 _header.php
-rw-r–r-- 1 root root 1283 Sep 10 19:12 help.php
drwxr-xr-x 9 root root 4096 Sep 10 19:12 images
drwxr-xr-x 4 root root 4096 Sep 10 19:12 inc
-rw-r–r-- 1 root root 1861 Sep 10 19:12 index.php
drwxr-xr-x 3 root root 4096 Sep 10 19:12 js
-rw-r–r-- 1 root root 35114 Sep 10 19:12 LICENSE
-rw-r–r-- 1 root root 11127 Sep 10 19:12 mpd-config.php
-rw-r–r-- 1 root root 10261 Sep 10 19:12 net-config2.php
-rw-r–r-- 1 root root 9249 Sep 10 19:12 net-config.php
drwxr-xr-x 5 root root 4096 Sep 10 19:12 _OS_SETTINGS
-rw-r–r-- 1 root root 3606 Sep 10 19:12 _player_engine.php
-rw-r–r-- 1 root root 765 Sep 10 19:12 README.md
-rw-r–r-- 1 root root 14340 Sep 10 19:12 settings.php
-rw-r–r-- 1 root root 6620 Sep 10 19:12 sources.php
drwxr-xr-x 2 root root 4096 Sep 10 19:12 templates
-rw-r–r-- 1 root root 3338 Sep 10 19:12 webradio_add2.php

Normally when you did “git checkout -b act_library” you should have seen a message saying that the branch act_library has been created and configured to track remote origin/act_library ; but if you say you don’t have the “updates” folder then probably it didn’t happen… no matter, you just have to reset your branch, that way :

git reset --hard origin/act_library

Ok that fixed it.

Alright - here’s the output of the output
root@volumio:/var/www/updates# ./update.py
Checking DB…
… Create DB file
[’/var/www/updates/runSQL.sh’, ‘/var/www/updates/init-db.sql’]
[‘chmod’, ‘a+w’, ‘/var/www/db/player.db’]
Module library-jotak: latest version is 1, current version is 0
Running update library-jotak.1
Checking SQL…
… SQL file found: library-jotak.1.sql
[’/var/www/updates/runSQL.sh’, ‘/var/www/updates/library-jotak.1.sql’]
Checking shell script…
… No shell script

Now the verdict - basically it seems to work but there is a problem with the layout.

I currently have one samba mount with about 8500-8600 tiles.
The files where available in Browse but the mount point was not listed in Menu-Library (the settings). Probably need to reset the database.
Enabling Library tab worked (i had to refresh the browser). Library scanning took 5-10 seconds and the files showed up in the Library tab (mutch faster that the first version in 1.4, I think it was.
But there is a layoutproblem. Tried to attach 2 screendumps, but extension was not allowed, I’ll try to set up via Drive. The guielements reacted to LMB but for some only the ones that did not overlap.
For exampleI was only able to play the last song in the right hand side list.
I’ll add another mount and see what happens if files exceed 10.000.

I hope this link works
drive.google.com/folderview?id= … sp=sharing

Kubuntu 14.04 – Firefox 32


OK, when I enterd the DB-setting (Menu-Library) the Library “tab” at the bottom disapeared. It’s not shown in any of the menu - selections.
If I select Browse, Playback or Playlist tab - the Library tab is returns.
Returning to any of the views in Setting(Menu) the Libary tab is gone and I only see the other three.

Added a new mount another 2500 titles .Opening Library tab, and access was almost instantaneous (after DB update finished) – :smiley:
But I still have the same layout problem.

Again added another mount with approx 1900 titles (totalling around 13.000 titles) and Library tab shows no songs :frowning:

I tried to disable and re-enable the tab but still no song shown. Browse tab seems to work fine.

I hope this is helpful - your work definitely is appreciated.

I will have to call it a night (Sweden) and try improve my wifes mood (she does not like it when I’m stuck at the computer too long)…


PS. I’m on a Pi B+ currently with the 1.41 image (+ one rpi-update). It’s my second device so I have no problems testing. DS

Thanks very much, yes it definitely helps, and you can tell your wife I’m sorry for her !

I’ve opened an issue on my github github.com/jotak/Volumio-WebUI/issues/10

I’ll see if I can reproduce it with fake data…

Joel think we need to tackle the 10k songs limit…

Just checked my tablet (android / firefox) and the scaling/layout issue was not here. The library gui looked and worked fine, loaded in about 10 second.
Note. I removed and re-added the mounts so I did not exceed the 10k limit (I’ll try with more files tonight)

Hi, some news about the issue.

I’m sorry to say I don’t come with a fix yet… and I couldn’t reproduce the layout issue.
Before continuing, just a word about the so-called “10K limit”: I’m pretty sure there is no barrier at 10K songs. There’s for sure some quantity of HTML/javascript content over which the browser doesn’t react well, but it will depend on many factors, including the number of songs, the songs repartition over artists and albums, the power of the device that runs the client browser, the browser itself and the OS (and you said that firefox on Android reacts better than firefox on KDE).

I’ve tried to reproduce:

  • On a recent PC running XFCE / Firefox
  • On a 5 years old PC running Windows / Firefox and IE

With 2 kinds of fake data:
1/ 10.000 songs in 1.000 artists and 10.000 albums (that is 10 songs per artist, and max. 21.000 objects displayed on screen)
2/ a quite improbable scenario of 10.000 songs in 10.000 artists and 10.000 albums (that is, max. 30.000 objects displayed on screen)

On scenario 1, both PC on firefox can handle it without much problem, even when all songs are displayed. IE is ok except when displaying all the songs, performances aren’t good. In no case the layout is broken.

On scenario 2 there’s clearly too many data displayed, it’s clearly not a good experience but it’s still possible to navigate through items (just need to be patient :frowning: ). The layout is not broken.

I even tried to display up to 90.000 songs/artists/albums on screen on my recent PC and it worked without breaking the layout (of course, it’s very slow!)

So what’s now?
I’d have liked to reproduce the layout issue :frowning:
I’ll try to implement a lazy-loading feature, but I can’t say if it’ll fix your layout issue.
At least, you can turn on and off the library now :confused:

PS: I’ve fixed the library tab not showing up in settings. To get the fix, go under /var/www and type “git pull”. You’ll have to restart the web server (sudo /etc/init.d/php5-fpm restart)


  • I see no change in Library tab behaviour. It’s still missing in the settings views. (tried both from computer and tablet+rebooted Pi)
  • "Layout in library tab - no change on PC or tablet. Tablet works fine (Firefox+Chrome)
    BUT - I can add that layout works fine on Chrome (same computer), so it probably is something specific with my Firefox install (or addon related)
    I also tried Konqueror and it never got past the “Loading” screen. Rekonq behavied as Chrome, and the tablet.
  • Adding my third mount (= more songs). No songs are listed on pc or tablet in library tab view (but the gui layout is still fine on tablet)
  • I don’t think the missing songs is network related, my home network is not slow and my Pi is cabel connected.

Did my “git pull” fail?? From the first part of the output it looks like it worked, but …

And again a big thank you for you’re efforts :smiley:


Thank YOU for helping me debugging my code :slight_smile:

Your git pull failed indeed. You may do as it says :

git branch --set-upstream act_library origin/act_library

=> this way, your local git branch will be “parented” with the remote branch.

then “git pull” again, and it should work

Then restart the php webserver


Some good news, I’ve started to implement the lazy-loading feature and it gives good results on performances.
It’s still experimental (you may try it and tell me if you find bugs), it’s not finished since I’ve implemented the “loading” part but I still need to do the “unloading” (that is, if you scroll down the lists until its end, you’ll end up with the same problems as before, since there’s going to be too much data loaded on page). That will be fixed soon.

just “git pull” my repo to get it (assuming you’ve done the “set-upstream” command as said before), and the restart php.

how it works:
It’s actually very basic: it initially displays a thousand elements, then when it detects some scrolling event has reached the bottom of the list, it just puts some more data (20 items) to the list. And so on…
If the usage shows that 1000 initial items is not enough, or too much, I can change it or make it configurable.

I am really eager to try it! In the meanwhile I m lurking and really happy about the discussion on library! Great work jotak and palle!

Looking very good :smiley: :smiley: (apart from “10k” problem :frowning: :frowning: ).

  • You’re first change for Library tab not showing in Settings-layouts seems to work fine. I’ve tested enabling disabling Library tab and changing back and forth and see no issues. One only needs to reload the page in the browser (F5) after enabling/disabling the tab.
  • Your Lazy-loading does seem to make a big difference for the Library. Load times are history when switching back and forth between Library tab/Browse/Playback it’s instantaneous. Though - initial load (when you start the browser) was about 10-15 second, probably needed to build the cache. That time will certainly vary depending on many factors :smiley: :smiley: :smiley:
  • However - I just added my third mount and Library view displays nothing, just as before. And it took a long time before it showed at initial load or browser refresh. Switching between the tabs is still very quick, but with nothing listed in Library view. :frowning: :frowning: :frowning:
  • I also did a test where I added the mount one level up in the structure, instead of three separate ones (1359 artists, 815 albums, 12309 songs) - unfortunately it made no difference.

There must be something in this since more users reported the same in the bug post.

Two other thing I noted in Library tab/view (before I added all of my titles):

I have added 3 images to the Drive - share. Library 4,5 and 6.
drive.google.com/folderview?id= … sp=sharing
They are screendumps from the Album panel.
In the first, Library 4, nothing is selected and you see that the artist part of 1812 overflows into the Album below.
Library 5 - If I now select 1812 it highlights both lines.
Library 6 - Selecting the Album below and the overflow from 1812 is not visible.
My guess is that the same applies to the other panels.
I think I read somewhere on the forum that someone suggested a tag/code change that would enable multiline (???)

A different thought is - is the artist part in the Album panel really needed. I’m personally a bit torn on this - If you select a specific album you often know who the artist is, but then having a large library (and getting old) you might not always remember, so …
Having the artist added to the album name also seems to cause an effect with Compilations. As you see in the screendumps. “Adagio - Music For Relaxing” is listed multiple times. It’s one album but with multiple artists. I guess this might vary depending on how you tag your music library.
What about using Albumartist instead of Artist in just the Album list. I’m far from a pro on best practice in setting the music tags, so I might have gotten it wrong. It tend to set “Album artist” to VA or Various Artists on compilations.

I also noted a difference in behaviour between Firefox and Chrome+Rekonq.
If I scroll down in the Album list and select an album further down:
A. In Firefox on tablet it is marked and the list does not change/jump - it works as expected.
B. In Chrome (on both tablet and PC) and Rekonq on PC the album list “jumps” back to the top. To see you’re selection you need to scroll back down again. It is still marked as it should be after selection.



Glad to hear it :slight_smile:

I wonder if it’s a server-side issue…

Yes, it’s a trivial css setting … I’ve just changed it (and commited on github), it now shows multilines

Why I choosed to show the artist associated with an album is for a simple reasons: sometimes several albums share the same name, or people may have some files not correctly tagged with “Unkown”-like albums (personnaly I have dozens of that), so when you want to browse albums without filtering on artists, it’s good to be able to see the differences when it’s ambiguous.

It should now be fixed in my last commit (although I didn’t test on Chrome)

Thanks for demining my code with your feedback

Al right, the multi line change worked on Chrome but not on Firefox (tablet) and even though I have that really weird layout problem in Firefox on my PC I can see that multi line did not work there either.

Jump to top is fixed … :slight_smile:

Is there any way to sort the song list? When I select an album the songs are not listed by track number.

And lastly the tagging. A question any programmer loves :wink: Is that configurable…?
What I mean is that since people probably have their music libraries organized and tagged in different ways.
Some prefer not the artist added to the album name, you prefer the artist, I would prefer album artist… (or some different handling specifically for albums tagged as compilations).
What about this, if compilation tag is set, show either album artist or just “Compilation”, otherwise show artist?

Ohh, and one other possible configuration option, fontsize. The font in the library tab is maybe on the smaller side. I don’t mind it since I want as much as possible displayed but I’m sure there are people who will have problems reading the text. What about a two setting switch, “default” and larger.

Again, great work


  • About multiline: it works on my firefox… maybe it’s a matter of cache, can you clear firefox cache?

  • About sorting songs: my songs are correctly sorted. There’s nothing in my code to actually sort them: MPD seems to do it for us. Can you check if you have, for instance, missing track information on those songs that are not sorted? I think MPD automatically sort them by track.

  • About configuration: there’s many things that we could make configurable, on the other hand we’ll probably don’t want to confuse people with too many configuration options… that’s something we must think about. But I agree, some options should be configurable. Maybe through a new settings screen dedicated to the library.

  • About compilations: it’s something difficult to handle. We’re dependant on what MPD provides to us, and it doesn’t provide all tags informations, since tags may differ according to file formats. I have access to “artist”, but not to “album artist” that we can see on some mp3s. Thus, when you have a compilation with 1 album name and several artists names, I see it as several albums, and that’s why you see them multiple times under “albums”. We could imagine a configurable option to “merge” albums that have the same name, but as a side effect, we could see some merged albums that are however truly different ones… We can imagine some workaround to overcome that, like looking at the folders structure to guess what is same album or not, assuming people put their music in a well organized file structure, which is not obligatory.