Currently, FilterIndexable() will discover the mime-type of the same file twice in most situations. First when it calls CreateFiltersFromPath, and again later on in FilterIndexable if we are dealing with a file. Index: beagled/FilterFactory.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/FilterFactory.cs,v retrieving revision 1.7 diff -u -B -p -r1.7 FilterFactory.cs --- beagled/FilterFactory.cs 30 Jun 2005 16:07:53 -0000 1.7 +++ beagled/FilterFactory.cs 30 Jun 2005 21:39:48 -0000 @@ -131,6 +131,14 @@ namespace Beagle.Daemon { return CreateFilters (uri, null, null); } + static public ICollection CreateFiltersFromIndexable (Indexable indexable) + { + string path = indexable.ContentUri.LocalPath; + string extension = Path.GetExtension (path); + string mime_type = indexable.MimeType; + return CreateFilters (UriFu.PathToFileUri (path), extension, mime_type); + } + ///////////////////////////////////////////////////////////////////////// static private bool ShouldWeFilterThis (Indexable indexable) @@ -171,17 +179,18 @@ namespace Beagle.Daemon { if (indexable.IsNonTransient) { // Otherwise sniff the mime-type from the file + if (indexable.MimeType == null) + indexable.MimeType = Beagle.Util.VFS.Mime.GetMimeType (path); + if (filters == null || filters.Count == 0) { - filters = CreateFiltersFromPath (path); + filters = CreateFiltersFromIndexable (indexable); } - + if (Directory.Exists (path)) { indexable.MimeType = "inode/directory"; indexable.NoContent = true; indexable.Timestamp = Directory.GetLastWriteTime (path); } else if (File.Exists (path)) { - if (indexable.MimeType == null) - indexable.MimeType = Beagle.Util.VFS.Mime.GetMimeType (path); indexable.Timestamp = File.GetLastWriteTime (path); } else { Logger.Log.Warn ("No such file: {0}", path);