Auto detect changes and rescan of library

Hi,

Not sure if this has been suggested or even if this happens already.

When adding new music to my mounted NAS, are you able to detect the change?

If so then perhaps this can trigger an automatic rescan of that mount point.

If not, then perhaps ability to add a scheduled rescan by the user would be useful.

Many thanks for your consideration.

3 Likes

Nothing wrong with a scheduled rescan, but I really don’t like a automatic rescan. Like to control the moment myself. Present options sufficient for me.

I add bits and pieces to my music collection all the time.
I have got into the routine of switching on Volumio at the same time as my tube amp.
Tube amp warms up while Volumio update sources.

Although I cant see why Volumio cannot be like FooBar2000 in this manner, that just constantly monitors your sources and newly added tracks are there with no messing around waiting for updates.

Back to Volumio, an option to automatically hit “update” sources button on startup would be a great addition, save having to manually do it each time I turn it on.

…and for those of us who leaves their RPi turned on 24/7, a scheduled option would be great.

I also use Foobar and love the fact it dynamically updates the libraries.
Plex does likewise…it detects, then appears to wait for 5-10 minutes, then updates!
Love it.

Unfortunately when it comes to NAS, we can’t detect the change automatically… This is a limitation of the inotify on linux which does not work on network mounted devices.

fair enough, If its a limitaiton then theres not alot can be done.

But as for the automation of doing an “update” on a schedule or simply doing it at startup… is this a possibility ?

The command mpc update <music path> will do the trick. You could add it as a cronjob.
For example I want to update the files from my NAS.

volumio@volumion2e50:~$ mpc ls
NAS
INTERNAL
USB

volumio@volumion2e50:~$ mpc update --wait NAS/

But please keep in mind that there is no process monitoring or gracefully close the scan, meaning if you decide to reboot during the scan, you need to rebuilt the dB from scratch as it will be gone.

So yes it is possible, but I would advise against it.

Thanks @Wheaten, this does work as suggested.
And another thing, your system is quite un responsive, with regards to playing music while updating, which may encourage you to reboot, of which that part is not unresponsive.

So yeah I see you point, this wouldnt be for everyone.

hmmm

Thanks again for the pointer, but for the interest of others, its not as simple a just adding the update command as a cron job.
If it runs before the network is ready or the NAS is not mounted you end up with an empty db. needing a complete rescan again.

With a small script to detect the mount, then when its available exectute the update command was the way forward and alot safer.

Might do a HOW TO and put it in the trouble makers section :slight_smile:

Just to click on “update folder” is what I mostly do and what is suffcient for me:

This seems like the sort of thing that would be very doable as part of default functionality, scheduled via the UI if wanted.