Re: [Rhythmbox-devel] Watched Directories



On Wed, 2005-10-19 at 08:31 +1000, Jonathan Matthew wrote:
> On Thu, Oct 06, 2005 at 01:35:57AM +1100, James Livingston wrote:
> > Attached is a small patch which lets Rhythmbox monitor directories for
> > new tracks. However there are several caveats:
> 
> I finally got around to trying this.  I accidentally selected
> 'Filesystem' (file:///) as my library location and so rhythmbox went off
> and tried to monitor my entire filesystem, which Did Not Work.  I think
> what happened is that gamin ran out of available file descriptors (I'm
> not using inotify) and pretty much gave up.  I had to edit the gconf key
> manually to recover from this.
> 
> A couple of options come to mind:
> - refuse to use file:/// as a library location
> - accept file:///, but only after a confirmation dialog (ugh)
> - don't apply the library location choice until the preferences window
>   is closed (also ugh)

You're right, I don't think that letting people monitor file:/// is a
good idea; in addition to the problems you mentioned, it will also have
issues with /dev/, /proc and the like.

The only reason I can think of that someone would want to do this, is if
they really want to monitor two locations and there is no UI for it.
They can do it with gconf-editor, and if enough people want it we could
add UI.


I've changed the patch so that
a) it will ignore file:/// and file://, so that they won't be monitored,
b) trying to set the library location to file:/// in the prefs window
will bring up an error (it could probably do with a better message), and
c) it doesn't apply until you close the dialog.


> It'd be nice if we could get 'file closed' notifications as well
> as 'file changed' - as it is, rhythmbox is reading the metadata for
> files about 8 times as I copy them into the library, which is
> sort of wasteful.  Perhaps instead we could only load modified files
> after they've been left alone for a few seconds.

AFAIK there is no way to find out when a file is closed, but we can wait
until it has stopped changing to do the load. I've made it queue the
file loads for later, and they won't occur until the file hasn't been
changed for 5-10 seconds.

I've fixed some problems when new files/directories weren't noticed. It
also ignore new files that aren't in a library directory; i.e. those
that happen to be in the same directory as an existing
out-of-library-dir file that RB knows about.


Cheers,

James "Doc" Livingston
-- 
Yeah, because you never know when the value of 2^15 will change and you
have to go through all your code fixing it. -- Paul Tomblin

Attachment: rb-watched-directories.patch.bz2
Description: application/bzip

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]