Verbose update and rescan

I think it would be nice if you could adjust the webUI to integrate “progress” on updating and rescanning of the music library.

Right now this seems like a walk in the dark. Can’t tell how long it will approximately take (disk size, how many files, how many hours of playtime…), how much is already done. There also doesn’t seem to be a “we’re done rescanning now, everything should be here now!” notification.

I think that this is a legitimate response to many of Volumio’s actions … too little feedback to the user about what (if anything) is happening. We should at the very least be sure that our mouse clicks are registered.

We can’t understand how long will take the library to rescan…
We currently provide feedback in the form of a spinning icon on the browse tab:

Scanning library -> spinning wheel
Not scanning library -> ordinary browse icon

rescan seems to be hit or miss.

I have a USB drive mounted which was scanned fine after it was inserted. If I then copy files over the network to the drive and click on Rescan, I get the spinning symbol but at the end the new files are not found in the browser.

But surely you could list the number of files in the target share and give a rough percentage estimate? Like if you’ve already scanned 5000 out of 10000 files, you could print out “library scanning (50%)”?

That’s not possible since we don’t have this information…

Well, no, of course not. You’d have to fetch it.

find /mnt/NAS/<share name>/ -type f -print | wc -l

I ran it with time to see how much overhead it would take:

[code]volumio@volumio:~$ time ./script.sh
10172

real 0m18.444s
user 0m0.040s
sys 0m0.260s[/code]

A quick list to find how many files there are, and then you can start the real scan that goes through each file and adds it to the DB if it is a known, readable type. Divide the number of files you’ve scanned so far with the total number of files, and you’d have the percentage.

I don’t remember exactly how long it took to scan my 10,000 files, but let’s say an hour. Adding 18 seconds to that hour in order to allow for a verbose progress in percent would, in my opinion, be perfectly acceptable.

That’s an idea…
However, there’s a fundamental problem there: it counts files, not audio files.
Since there might be lots of different files into the share: albumart, infos txt, cue files etc we will never reach 100%

Well, I don’t know exactly how your scan process operates, but if you limit the DB scan by file type, then just add a grep or find variable for those file types. This isn’t really an issue whatsoever, there are tons of solutions depending on exactly how you want to implement it.

My point was simply that it’s trivial to create a number of total files to be scanned before you go through and scan them, so that there is data enough to provide an estimated progress calculation.

Then, if you want to get fancy, you could simply time each individual file scan as well and create an average. Multiply the total number of files with the average (minus the ones you already scanned), and now you have a basic “time left” calculation as well. Keep doing new average every 100 files or so, and the calculation should remain relatively accurate.

Example:

find /mnt/NAS/Alexandria/ -type f -print | grep 'mp3' | wc -l

[code]volumio@volumio:~$ time ./script.sh
6576

real 0m21.634s
user 0m0.070s
sys 0m0.150s[/code]

Of course, this probably isn’t the most optimized way of doing it, but it does the job. Just write a regex to match all the file types you support.

Hello
this is a feature i would need too.
i am changeing all my file from mp3 to FLAC so the directory should be scanned all “10” Minutes.
it could also give the Information
total file 8945
scanned 2545

by the way where Volumio will take the Information of the CD? i found out it is not showing the CD.Cover i added with MusicBee.

have a nice day
vinc