Nautilus (kraken) ... just a little info for the two other people who use gnome on openSUSE

OK, there are probably more than two other gnome users here … but I do like hyperbole.

Many years ago, when gnome development actually focused on adding useful features instead of removing them, nautilus added a search filter. So you can search for everything called “foo” and limit the results to all “foo” that is video. That works great so long as foo is not foo.mkv! A genuinely stupid oversight that the gnome team will NEVER fix! And the fix is TRIVIAL!

--- nautilus-45.2.1.orig/src/nautilus-mime-actions.c  2023-12-06 04:03:31.000000000 -0600
+++ nautilus-45.2.1/src/nautilus-mime-actions.c 2024-06-29 07:55:53.466029698 -0500
@@ -152,6 +152,7 @@
         "audio/x-mpeg",
         "audio/x-ms-asx",
         "audio/x-pn-realaudio",
+        "audio/x-matroska",
         NULL}},
     { N_("PDF / PostScript"),
       { "application/pdf",
@@ -217,6 +218,7 @@
         "video/x-msvideo",
         "video/x-nsv",
         "video/x-real-video",
+        "video/x-matroska",
         NULL}}
 };

This same patch can be applied to any version of nautilus going back many many years.

Also going back to a time when gnome added useful features instead of removing them, nautilus integrated tracker results into it’s search engine. Hottest thing since sliced bread! OK, I like cliché as well as hyperbole; I wish I could “zypper dup” on my brain. I can search my music by “soundtrack” and limit my results to songs that are from films, even though the word “soundtrack” is NOT in the filename. I can search my videos by “thiller” and get a list of suspenseful movies even though the word “thriller” is not in any of the file names.

Of coarse, users of windoZe and osX enjoy similar functionality and have for years.

When gnome migrated from tracker2 to tracker3, this feature got broken. My best guess is that it was originally an oversight, but with gnome it is really hard to tell. (I have reported bugs only to learn that the “bug” was actually a “design choice” … I don’t waste my time reporting bugs to gnome anymore … eventually I will go back to cinnamon even though I prefer gnome …) Up until the latest releases of nautilus, the fix was extremely simple:

--- nautilus-42.2-orig/src/nautilus-search-engine-tracker.c	2022-09-02 22:46:05.740683749 -0500
+++ nautilus-42.2/src/nautilus-search-engine-tracker.c	2022-09-02 22:51:19.515838433 -0500
@@ -364,7 +364,7 @@
 
     if (tracker->fts_enabled)
     {
-        g_string_append (sparql, "FROM tracker:Documents ");
+        g_string_append (sparql, "FROM tracker:Documents FROM tracker:Pictures FROM tracker:Audio FROM tracker:Video");
     }
 
     g_string_append (sparql,

Not exactly the same for nautilus 44, but the same idea works … add the missing “FROM” strings.

With nautilus 45, it gets slightly more complicated:

--- nautilus-45.2.1.orig/src/nautilus-search-engine-tracker.c	2023-12-06 04:03:31.000000000 -0600
+++ nautilus-45.2.1/src/nautilus-search-engine-tracker.c	2024-06-29 15:18:24.914066641 -0500
@@ -369,17 +369,55 @@
         {
             g_string_append (sparql,
                              " { "
-                             "   SELECT ?file " VARIABLES " {"
-                             "     GRAPH tracker:Documents {"
-                             "       ?file a nfo:FileDataObject ."
-                             "       ?content nie:isStoredAs ?file ."
-                             "       ?content fts:match ~match ."
-                             "       BIND(fts:rank(?content) AS ?rank) ."
-                             "       BIND(fts:snippet(?content,"
+                             "   SELECT ?file " VARIABLES " WHERE {"
+                             "     {"
+                             "       GRAPH tracker:Documents {"
+                             "         ?file a nfo:FileDataObject ."
+                             "         ?content nie:isStoredAs ?file ."
+                             "         ?content fts:match ~match ."
+                             "         BIND(fts:rank(?content) AS ?rank) ."
+                             "         BIND(fts:snippet(?content,"
                              "                        '_NAUTILUS_SNIPPET_DELIM_START_',"
                              "                        '_NAUTILUS_SNIPPET_DELIM_END_',"
                              "                        '…',"
                              "                        20) AS ?snippet)"
+                             "       }"
+                             "     } UNION {"
+                             "       GRAPH tracker:Pictures {"
+                             "         ?file a nfo:FileDataObject ."
+                             "         ?content nie:isStoredAs ?file ."
+                             "         ?content fts:match ~match ."
+                             "         BIND(fts:rank(?content) AS ?rank) ."
+                             "         BIND(fts:snippet(?content,"
+                             "                        '_NAUTILUS_SNIPPET_DELIM_START_',"
+                             "                        '_NAUTILUS_SNIPPET_DELIM_END_',"
+                             "                        '…',"
+                             "                        20) AS ?snippet)"
+                             "       }"
+                             "     } UNION {"
+                             "       GRAPH tracker:Audio {"
+                             "         ?file a nfo:FileDataObject ."
+                             "         ?content nie:isStoredAs ?file ."
+                             "         ?content fts:match ~match ."
+                             "         BIND(fts:rank(?content) AS ?rank) ."
+                             "         BIND(fts:snippet(?content,"
+                             "                        '_NAUTILUS_SNIPPET_DELIM_START_',"
+                             "                        '_NAUTILUS_SNIPPET_DELIM_END_',"
+                             "                        '…',"
+                             "                        20) AS ?snippet)"
+                             "       }"
+                             "     } UNION {"
+                             "       GRAPH tracker:Video {"
+                             "         ?file a nfo:FileDataObject ."
+                             "         ?content nie:isStoredAs ?file ."
+                             "         ?content fts:match ~match ."
+                             "         BIND(fts:rank(?content) AS ?rank) ."
+                             "         BIND(fts:snippet(?content,"
+                             "                        '_NAUTILUS_SNIPPET_DELIM_START_',"
+                             "                        '_NAUTILUS_SNIPPET_DELIM_END_',"
+                             "                        '…',"
+                             "                        20) AS ?snippet)"
+                             "       }"
                              "     }"
                              "     GRAPH tracker:FileSystem {"
                              TRIPLE_PATTERN

While I think there is probably a more elegant way to rewrite the search, this quick and dirty patch works and the performance is still good.

If I ever get sufficiently motivated, I am going to fork nautilus and start re-adding all the useful features that have been removed.

I will call it KRAKEN!

Now what is the real Multimedia question you try to ask from the openSUSE users here that try to help other openSUSE users with problems they have.

The question is “How do I get nautilus search to match metadata embedded in my multimedia files?” The answer is in the provided patches. I believe the same result can be accomplished on KDE by installing and tweaking baloo, but I am not certain of this.

Most users are not going to re-compile nautilus and probably would not even know what “patch” is. Providing link to a maintained openSUSE package that includes this patch would be the best. Providing link to a bug report or PR would allow users to follow it. Did you submit this patch upstream?

Hello arvidjaar,

Thank you for the response.

You make a VERY GOOD point, “Most users …”.

I really have no idea what level of knowledge the “average” user of openSUSE might have. About the only thing I can deduce is that they must be knowledgeable enough to install an os, as I don’t think there are many vendors selling computers with opeSUSE pre-installed. I feel safe assuming that the “average” user knows more than my Mom :slight_smile:.

But to assume that users generally know what to do with a patch? Yeah, that is a STRETCH!

Providing link to a maintained openSUSE package that includes this patch would be the best.

I like that idea, as I think nautilus users should enjoy the infrastructure that is already in place. I guess the best way to that would be to build it in OBS. Tracker is an amazingly good tool that is underutilized because of a couple of rather silly bugs in nautilus. I bet there many nautilus users who don’t even remember nautilus with fully functional tracker integration.

I reported both bugs in August of 2022. I included patches in both bug reports, though it took me a few days to figure out why nautilus search was not working as expected and add the patch. I posted the newest nautilus patch to gnome discourse a few days ago; gnome can do or not do with it as they please. That is the absolute maximum of my willingness to interact with gnome developers.

Prior to adding the patch to the search bug, Sam ___ (the principal developer behind tracker), was extremely helpful and generous with his time as I was debugging the problem.

The few interactions I have had with other Gnome developers left me committed to NEVER again report a bug in gnome.

If you or anyone else cares to report or fix these bugs in gnome … go for it … take the credit … I would actually appreciate it!

I don’t like maintaining other people’s code. I don’t like taking the time to figure out how to fix the newer version of nautilus I get each year when I upgrade my os.

I guess it is time to figure out how to use OBS …

As per arvidjaar’s suggestion:

Install package home:oxWrongAgain / nautilus

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.