[tracker/extractor-rules-list: 5/5] miner-fs: avoid roundtrips to the extractor



commit 477f4cb2e3e0d252c13d022d4b7fcaa70e8e74e0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Mar 10 13:19:22 2011 +0100

    miner-fs: avoid roundtrips to the extractor
    
    The miner now queries the extractor module manager whether a
    file is actually handled by the extractors before sending it
    over.

 src/miners/fs/Makefile.am           |    1 +
 src/miners/fs/tracker-miner-files.c |   10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/miners/fs/Makefile.am b/src/miners/fs/Makefile.am
index 6af53b2..e7667ea 100644
--- a/src/miners/fs/Makefile.am
+++ b/src/miners/fs/Makefile.am
@@ -44,6 +44,7 @@ tracker_miner_fs_SOURCES =                             \
 tracker_miner_fs_LDADD =                               \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-extract/libtracker-extract- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-data/libtracker-data.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index 32e6975..c3f2516 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -42,6 +42,8 @@
 
 #include <libtracker-data/tracker-db-manager.h>
 
+#include <libtracker-extract/tracker-extract-module-manager.h>
+
 #include "tracker-power.h"
 #include "tracker-miner-files.h"
 #include "tracker-config.h"
@@ -2447,13 +2449,13 @@ process_file_cb (GObject      *object,
 
 	miner_files_add_to_datasource (data->miner, file, sparql);
 
-	if (!is_directory) {
-		/* Next step, if NOT a directory, get embedded metadata */
+	if (tracker_extract_module_manager_mimetype_is_handled (mime_type)) {
+		/* Next step, if handled by the extractor, get embedded metadata */
 		extractor_get_embedded_metadata (data, uri, mime_type);
 	} else {
-		/* For directories, don't request embedded metadata extraction.
+		/* Otherwise, don't request embedded metadata extraction.
 		 * We setup an idle so that we keep the previous behavior. */
-		g_debug ("Avoiding embedded metadata request for directory '%s'", uri);
+		g_debug ("Avoiding embedded metadata request for uri '%s'", uri);
 		g_idle_add (extractor_skip_embedded_metadata_idle, data);
 	}
 



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