Page 1 of 1

Mpc update right after a device mount lead me to songs missing problem

Posted: October 2nd, 2019, 9:24 am
by Sogeking
Hi,

i'm having this problem with a c++ (with qt) program i'v developed.
I call a system command "mount" to mount a device in my raspberry. Right after when mount process is finished i call "mpc update" to update the music database but a lot of songs are missing. If i call mpc update manualy some seconds right after mpc can find all songs correctly.

So the question is: "how can i be sure that the mount process is correctly ended in order to update mpc with all the songs?"

Thanks

Re: Mpc update right after a device mount lead me to songs missing problem

Posted: October 2nd, 2019, 10:17 am
by max
The mount process is finished when the command finishes.

But that doesn't imply that the database update is finished at the same time, just like regular database updates aren't finished then. To wait for update completion, use `mpc update --wait`.
But that has nothing to do with mounting, that's how MPD always works.