After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 307812 - beagle should index nautilus metadata
beagle should index nautilus metadata
Status: RESOLVED FIXED
Product: beagle
Classification: Other
Component: General
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Joe Shaw
Beagle Bugs
: 340768 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-06-15 17:01 UTC by Jon Trowbridge
Modified: 2007-03-06 21:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
not so working patch (12.66 KB, patch)
2006-04-16 12:46 UTC, Lukas Lipka
none Details | Review
It indexes it.... (6.12 KB, patch)
2006-04-24 08:26 UTC, Kevin Kubasik
none Details | Review
Index Nautilus Notes, with preliminary inotify (9.48 KB, patch)
2006-05-10 19:27 UTC, Kevin Kubasik
none Details | Review
Update, and adds Emblem Support, along with UI integration. (11.58 KB, patch)
2006-05-26 08:29 UTC, Kevin Kubasik
none Details | Review
Updated Patch for Nautilus Metadata Indexing (13.80 KB, patch)
2006-06-13 01:36 UTC, Kevin Kubasik
none Details | Review
Add basic support for directories metadata (15.68 KB, text/x-patch)
2006-06-19 13:43 UTC, Kevin Kubasik
  Details
Update Inotify stuff (17.03 KB, patch)
2006-06-19 15:54 UTC, Kevin Kubasik
none Details | Review
First cut at this (9.72 KB, patch)
2006-06-21 22:13 UTC, Joe Shaw
needs-work Details | Review
Updated patch (12.63 KB, patch)
2006-06-22 22:28 UTC, Joe Shaw
needs-work Details | Review
Minor adjustments/sanity checks (10.15 KB, patch)
2006-08-13 12:33 UTC, Kevin Kubasik
none Details | Review
Another Update, more solid, still needs UI work though. (11.61 KB, patch)
2006-12-13 15:34 UTC, Kevin Kubasik
none Details | Review

Description Jon Trowbridge 2005-06-15 17:01:50 UTC
We need to index nautilus emblems and notes.
Comment 1 Lukas Lipka 2005-07-13 08:29:16 UTC
OK, I have got a first pass of this working, still needs some tuning.
Comment 2 Robert Da Campo 2005-10-17 21:29:06 UTC
Doesn't seem to be in (it does not work for me and this bug does still exist) so
maybe this patch i found on the dashboard mailing list does what we want?

http://mail.gnome.org/archives/dashboard-hackers/2004-June/msg00032.html
Comment 3 Lukas Lipka 2006-04-16 12:45:48 UTC
I managed to dig up the old patch which I was working on. But it is still far from finished, I'm putting it here in case anyone else wants to continue work on it. I dont have the time or will to work on it more at the moment. Sorry. :-)

Known problems:

 * We have to use the sqlite store for the metadata files (see bgo #315228)

 * NautilusTools suck - I used XmlSerialization which sucks and is much of an overhead. This should be reimplemented. Actually the whole file is a mess, a rewrite would really help it!

  * There is no way of knowing when the metadata for a file was deleted.

  * Code needs to be written which would update the already indexed files when the metadata for them is added. There are FIXMEs in NautilusMetadataCrawler.cs for this.

  * I haven't touched this code for ages so it might now work anymore and I'm not sure I have written all the issues that I faced before.

It is very hard to write this in a way that will work perfectly.
Comment 4 Lukas Lipka 2006-04-16 12:46:48 UTC
Created attachment 63633 [details] [review]
not so working patch
Comment 5 Kevin Kubasik 2006-04-20 11:52:14 UTC
is this bug outdated in CVS? or is this still unimplemented, in which case, I would be willing to look at some of the NautilusTools code and update/get that working.
Comment 6 Lukas Lipka 2006-04-20 13:19:14 UTC
I think this doesn't work at all in CVS. The patch I posted above is most likely the best way to go but it hasn't been touched in ages and is a total mess. And also it needs fixing the issues I pointed above.
Comment 7 Kevin Kubasik 2006-04-24 08:26:21 UTC
Created attachment 64178 [details] [review]
It indexes it....

This probably does about 400 things wrong, but it works at the core, and adding the UI elementto display an emblem or add a note should be pretty easy for anyone with gtk experiance.
Comment 8 Olav Vitters 2006-05-10 19:24:23 UTC
*** Bug 340768 has been marked as a duplicate of this bug. ***
Comment 9 Kevin Kubasik 2006-05-10 19:27:33 UTC
Created attachment 65193 [details] [review]
Index Nautilus Notes, with preliminary inotify

Ok, this not only indexes all nautilus notes (into beagle:notes property) but has some basic inotify support going on to detect changes to notes and react instantaneously.

I need a lot of help testing this, since I don't really use notes regularly.
Comment 10 Kevin Kubasik 2006-05-26 08:29:38 UTC
Created attachment 66258 [details] [review]
Update, and adds Emblem Support, along with UI integration.

Another update to my patch, fixes an issue with inotify events being called before the queryable has finished initializing. Also adds initial indexing of emblems, and the UI elements to super impose emblems much the same way we do with f-spot. To test this, you need to have the emblem image file in the beagle images folder.
Comment 11 Kevin Kubasik 2006-06-13 01:36:57 UTC
Created attachment 67223 [details] [review]
Updated Patch for Nautilus Metadata Indexing

Ok, this is a pretty major patch compared to the others up here. This is not only significantly more stable, but just makes more sense. All metadata is indexed in the FSQ and I have added emblem support based upon the current theme, in short, this is cool, and you should consider giving it a try and me some feedback :)
Comment 12 Kevin Kubasik 2006-06-19 13:43:38 UTC
Created attachment 67631 [details]
Add basic support for directories metadata
Comment 13 Kevin Kubasik 2006-06-19 15:54:41 UTC
Created attachment 67639 [details] [review]
Update Inotify stuff

Ok, I had to scrap some of the instantaneous Inotify stuff in favor of just queuing the directory for a recrawl. In short, it wasn't working and there wasn't and efficient way to respond to an inotify event.
Comment 14 Joe Shaw 2006-06-21 22:13:58 UTC
Created attachment 67819 [details] [review]
First cut at this

Here's my first pass at it.  All the nautilus code is separated out into its own file, and the FSQ code only calls into it thrice.

Properties are not updated correctly when the metafiles change, because the URIs need to be remapped from the external file URIs to the internal uid URIs.  Figuring out how to cleanly do that is the next step.  I just wanted to checkpoint in case I don't come back to this before GUADEC.
Comment 15 Joe Shaw 2006-06-22 22:28:47 UTC
Created attachment 67871 [details] [review]
Updated patch

Rewriting of the existing properties now works correctly.  Started doing the UI part based on Kevin's work, but the pixbuf.Composite() function is crashing for me for some reason which I'll need to check into later.
Comment 16 Max Wiehle 2006-06-23 08:36:45 UTC
Hi

> ...  Started doing the UI
> part based on Kevin's work, but the pixbuf.Composite() function is crashing for
> me for some reason which I'll need to check into later.

Ran into a similar problem trying to compose images for RSS Feeds - If you find out why it crashes please let me know.

 Max

Comment 17 Kevin Kubasik 2006-07-05 09:53:33 UTC
Ok, one bug I have been noticing with the nautilus stuff is as follows

Debug: -http://digg.com/users/kkubasik/friends/list
Debug: +http://digg.com/users/kkubasik/friends/list
Warn: Caught exception in DoTaskReal
Warn:         Tag: Tree Crawler
Warn:     Creator:
Warn: Description: Pending directories: 1
Warn:    Priority: Delayed (0)
Warn: System.NullReferenceException: Object reference not set to an instance of an object
in [0x00020] (at /home/kjk38/mysrc/beagle-svn/Util/NautilusTools.cs:87) Beagle.Util.NautilusTools:GetMetaFileNode (System.String path)
in [0x00001] (at /home/kjk38/mysrc/beagle-svn/Util/NautilusTools.cs:119) Beagle.Util.NautilusTools:GetEmblem (System.String path)
in [0x00001] (at /home/kjk38/mysrc/beagle-svn/beagled/FileSystemQueryable/NautilusMetadata.cs:113) Beagle.Daemon.FileSystemQueryable.NautilusMetadata:AddPropertiesToIndexable (Beagle.Indexable indexable, System.String path)
in [0x0005d] (at /home/kjk38/mysrc/beagle-svn/beagled/FileSystemQueryable/FileSystemQueryable.cs:235) Beagle.Daemon.FileSystemQueryable.FileSystemQueryable:DirectoryToIndexable (System.String path, Guid id, Beagle.Daemon.FileSystemQueryable.DirectoryModel parent)
in [0x0004d] (at /home/kjk38/mysrc/beagle-svn/beagled/FileSystemQueryable/FileSystemQueryable.cs:567) Beagle.Daemon.FileSystemQueryable.FileSystemQueryable:ScheduleDirectory (System.String name, Beagle.Daemon.FileSystemQueryable.DirectoryModel parent, Beagle.Daemon.FileAttributes attr, Boolean is_walkable)
in [0x00117] (at /home/kjk38/mysrc/beagle-svn/beagled/FileSystemQueryable/FileSystemQueryable.cs:499) Beagle.Daemon.FileSystemQueryable.FileSystemQueryable:AddDirectory (Beagle.Daemon.FileSystemQueryable.DirectoryModel parent, System.String name)
in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_DirectoryModel_string (Beagle.Daemon.FileSystemQueryable.DirectoryModel,string)
in [0x000e3] (at /home/kjk38/mysrc/beagle-svn/beagled/FileSystemQueryable/TreeCrawlTask.cs:100) Beagle.Daemon.FileSystemQueryable.TreeCrawlTask:DoTaskReal ()
in [0x00054] (at /home/kjk38/mysrc/beagle-svn/Util/Scheduler.cs:267) Beagle.Util.Scheduler+Task:DoTask ()
Debug: -http://digg.com/users/kkubasik/friends/list
Debug: +http://digg.com/users/kkubasik/friends/list



It only seems to occur when there is a hidden file, I'm gonna look at the code now, but getting it here in case I forget.
Comment 18 Kevin Kubasik 2006-07-05 10:27:45 UTC
Ok, I think something like this should fix the error above.

Index: Util/NautilusTools.cs
===================================================================
--- Util/NautilusTools.cs       (revision 72)
+++ Util/NautilusTools.cs       (working copy)
@@ -82,6 +82,8 @@
                        XmlDocument doc = GetMetaFileDoc (path);

                        string name = Path.GetFileName (path);
+                       if (name == null)
+                               return null;
                        string xpath = String.Format ("/directory/file[@name=\"{0}\"]", StringFu.HexEscape (name));
                        return doc.SelectSingleNode (xpath);
                }




And I noticed something else, Joe chose to make the emblems stored as unsearched, it seems to me that they might actually be more of keywords, because of their significance. Unfortunately, the defaults take very sweeping names, so I dunno, but it would seem if I made an emblem say 'beagle' then a search for beagle would ideally return all my files tagged as beagle. 

Just a thought, this seems like something good to get rolling soon, since max will probably want to integrate it with a lot of his stuff.

Comment 19 Kevin Kubasik 2006-08-13 12:33:46 UTC
Created attachment 70814 [details] [review]
Minor adjustments/sanity checks

Just some sanity checks and the like.
Comment 20 Kevin Kubasik 2006-09-02 22:39:03 UTC
Any thoughs on if/when we should aim to get this in CVS? And a recap of major todo's would be greatly appreciated on my part.
Comment 21 Joe Shaw 2006-09-05 19:39:27 UTC
I had kind of been holding off on this until Max's metadata work went in, but it's probably ok to do beforehand.

I don't understand why the Path.GetFileName() method is returning null and causing the error you're seeing.  The null check might be working around another bug.

As for emblems, the right thing to do is probably to make them searched, but stored individually, instead of all as one property.
Comment 22 Kevin Kubasik 2006-12-13 15:34:10 UTC
Created attachment 78291 [details] [review]
Another Update, more solid, still needs UI work though.

Ok, more updating work on this, more or less functional, the whole emblems on the search result thing still doesn't work quite right, but were indexing and handling events well, so thats a start!

Let me know what you think.
Comment 23 Joe Shaw 2006-12-13 18:11:10 UTC
I found out what the cause of the crashing was: the image we were trying to composite to was read-only because it was mmap()ed in.

See this commit for more info:
http://cvs.gnome.org/bonsai/cvsquery.cgi?branch=&dir=beagle&who=joeshaw&date=explicit&mindate=2006-12-04%2014:58&maxdate=2006-12-04%2015:00

As for the code itself, it seems fine, although nautilus metadata is a prime candidate for a backend after landing the unified indexes branch.  Unfortunately, I don't know when that will be.
Comment 24 Joe Shaw 2007-03-06 20:37:38 UTC
I just checked in support for indexing additional metadata from different backends, and implemented Nautilus metadata this way.

See http://svn.gnome.org/viewcvs/beagle?view=rev&revision=3536 for more info.

The last patch is obsolete, but there are still a couple of things in there that are worth using.  I'll extract what I can from there and check it in.
Comment 25 Joe Shaw 2007-03-06 21:08:16 UTC
Checked the rest of it in as r3537.