Comment 9 for bug 153054

reacocard (reacocard) wrote :

"You should go for a configuration setting with which the user can indicate which directiories contain dynamic content."
That is essentially what my second suggestion does, except it places the indication in an existing place well suited to handling it - the library system.

"I'd suggest to have a little background task running which checks every X seconds..."
I'd rather not, polling is an ugly solution, especially when it causes disk activity. 0.3 will have pyinotify support at least for this, and as you suggest later we could just listen to HAL or GVFS over DBUS for the mount/unmount... except not all mounts are necessarily handled by them. Polling/listening also has the problem that it only works while Exaile is running. If you unmount the drive while Exaile is closed, when exaile is started again how does it know that that folder is now unmounted, instead of just deleted? I guess you could look at /etc/mtab, but that's both hackish and linux-dependent.

Really I think the simplest solution would be to make the Mass Storage device plugin capable of everything you can do with the normal collection and then just use that for any kind of removable disk like this. You'd have to cache the DB on the disk to avoid huge startup times, but that's trivial to do. This would also have the advantage that you could then plug the same drive into another system with Exaile and have the entire same collection at hand, complete with ratings/playcounts/etc.