Commit 6420ec63 authored by Jürg Billeter's avatar Jürg Billeter

tracker-extract: Support extra string for WHERE patterns in GetMetadata

parent fa562b4a
......@@ -21,6 +21,7 @@
<arg type="s" name="mime" direction="in" />
<arg type="s" name="preupdate" direction="out" />
<arg type="s" name="embedded" direction="out" />
<arg type="s" name="where" direction="out" />
</method>
</interface>
</node>
......@@ -30,7 +30,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
/* NOTE: This function has to exist, tracker-extract checks
* the symbole table for this function and if it doesn't
......
......@@ -60,7 +60,8 @@ G_BEGIN_DECLS
* tracker_extract_get_metadata (const gchar *uri,
* const gchar *mimetype,
* TrackerSparqlBuilder *preupdate,
* TrackerSparqlBuilder *metadata)
* TrackerSparqlBuilder *metadata,
* GString *where)
* {
* gint height, width;
*
......@@ -101,6 +102,7 @@ G_BEGIN_DECLS
* are a prerequisite for the actual file
* metadata insertion.
* @metadata: used to populate with file metadata predicate/object(s).
* @where: used for optional WHERE patterns
*
* This function must be provided by ALL extractors. This is merely
* the declaration of the function which must be written by each
......@@ -135,7 +137,8 @@ G_BEGIN_DECLS
gboolean tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata);
TrackerSparqlBuilder *metadata,
GString *where);
G_END_DECLS
......
......@@ -34,7 +34,8 @@ G_BEGIN_DECLS
typedef gboolean (* TrackerExtractMetadataFunc) (const gchar *uri,
const gchar *mime_type,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata);
TrackerSparqlBuilder *metadata,
GString *where);
gboolean tracker_extract_module_manager_init (void) G_GNUC_CONST;
......
......@@ -657,12 +657,12 @@ tracker_xmp_free (TrackerXmpData *data)
gboolean
tracker_xmp_apply (TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata,
GString *where,
const gchar *uri,
TrackerXmpData *data)
{
GPtrArray *keywords;
guint i;
GString *where = NULL;
g_return_val_if_fail (TRACKER_SPARQL_IS_BUILDER (metadata), FALSE);
g_return_val_if_fail (uri != NULL, FALSE);
......@@ -704,10 +704,6 @@ tracker_xmp_apply (TrackerSparqlBuilder *preupdate,
tracker_sparql_builder_predicate (metadata, "nao:hasTag");
tracker_sparql_builder_object_variable (metadata, var);
if (where == NULL) {
where = g_string_new ("} } WHERE { {\n");
}
g_string_append_printf (where, "?%s a nao:Tag ; nao:prefLabel \"%s\" .\n", var, escaped);
g_free (var);
......@@ -937,10 +933,5 @@ tracker_xmp_apply (TrackerSparqlBuilder *preupdate,
}
if (where != NULL) {
tracker_sparql_builder_append (metadata, where->str);
g_string_free (where, TRUE);
}
return TRUE;
}
......@@ -90,6 +90,7 @@ TrackerXmpData * tracker_xmp_new (const gchar *buffer,
void tracker_xmp_free (TrackerXmpData *data);
gboolean tracker_xmp_apply (TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata,
GString *where,
const gchar *uri,
TrackerXmpData *data);
......
......@@ -77,6 +77,7 @@ struct ProcessFileData {
typedef void (*fast_async_cb) (const gchar *preupdate,
const gchar *sparql,
const gchar *where,
GError *error,
gpointer user_data);
......@@ -1950,6 +1951,7 @@ process_file_data_free (ProcessFileData *data)
static void
extractor_get_embedded_metadata_cb (const gchar *preupdate,
const gchar *sparql,
const gchar *where,
GError *error,
gpointer user_data)
{
......@@ -1985,6 +1987,12 @@ extractor_get_embedded_metadata_cb (const gchar *preupdate,
tracker_sparql_builder_graph_close (data->sparql);
tracker_sparql_builder_insert_close (data->sparql);
if (where && *where) {
tracker_sparql_builder_where_open (data->sparql);
tracker_sparql_builder_append (data->sparql, where);
tracker_sparql_builder_where_close (data->sparql);
}
/* Prepend preupdate queries */
if (preupdate && *preupdate) {
tracker_sparql_builder_prepend (data->sparql, preupdate);
......@@ -2055,7 +2063,7 @@ extractor_get_embedded_metadata_cancel (GCancellable *cancellable,
static gboolean
extractor_skip_embedded_metadata_idle (gpointer user_data)
{
extractor_get_embedded_metadata_cb (NULL, NULL, NULL, user_data);
extractor_get_embedded_metadata_cb (NULL, NULL, NULL, NULL, user_data);
return FALSE;
}
......@@ -2251,22 +2259,35 @@ get_metadata_fast_cb (void *buffer,
{
FastAsyncData *data;
ProcessFileData *process_data;
gboolean valid_input = FALSE;
gboolean free_error = FALSE;
const gchar *preupdate = NULL;
const gchar *sparql = NULL;
const gchar *where = NULL;
data = user_data;
process_data = data->user_data;
if (!error && buffer_size) {
gsize preupdate_length;
gsize preupdate_length, sparql_length, where_length;
preupdate = buffer;
preupdate_length = strnlen (preupdate, buffer_size);
if (preupdate_length < buffer_size && preupdate[buffer_size - 1] == '\0') {
preupdate_length = strnlen (preupdate, buffer_size - 1);
if (preupdate[preupdate_length] == '\0') {
/* sparql is stored just after preupdate in the original buffer */
sparql = preupdate + preupdate_length + 1;
} else {
sparql_length = strnlen (sparql, preupdate + buffer_size - 1 - sparql);
if (sparql[sparql_length] == '\0') {
/* where is stored just after sparql in the original buffer */
where = sparql + sparql_length + 1;
where_length = strnlen (where, preupdate + buffer_size - 1 - where);
if (where[where_length] == '\0') {
valid_input = TRUE;
}
}
}
if (!valid_input) {
error = g_error_new_literal (miner_files_error_quark,
0,
"Invalid data received from GetMetadataFast");
......@@ -2276,13 +2297,13 @@ get_metadata_fast_cb (void *buffer,
if (G_UNLIKELY (error)) {
if (error->code != G_IO_ERROR_CANCELLED) {
(* data->callback) (NULL, NULL, error, process_data);
(* data->callback) (NULL, NULL, NULL, error, process_data);
}
if (free_error) {
g_error_free (error);
}
} else {
(* data->callback) (preupdate, sparql, NULL, data->user_data);
(* data->callback) (preupdate, sparql, where, NULL, data->user_data);
}
fast_async_data_free (data);
......
......@@ -41,7 +41,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
FILE *f;
gchar *filename;
......
......@@ -154,7 +154,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
FLAC__Metadata_SimpleIterator *iter;
FLAC__StreamMetadata *stream = NULL, *vorbis, *picture;
......
......@@ -71,6 +71,7 @@ ext_block_append(ExtBlock *extBlock,
static void
read_metadata (TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata,
GString *where,
GifFileType *gifFile,
const gchar *uri)
{
......@@ -84,7 +85,6 @@ read_metadata (TrackerSparqlBuilder *preupdate,
MergeData md = { 0 };
GifData gd = { 0 };
TrackerXmpData *xd = NULL;
GString *where = NULL;
do {
GifByteType *ExtData;
......@@ -363,10 +363,6 @@ read_metadata (TrackerSparqlBuilder *preupdate,
tracker_sparql_builder_predicate (metadata, "nao:hasTag");
tracker_sparql_builder_object_variable (metadata, var);
if (where == NULL) {
where = g_string_new ("} } WHERE { {\n");
}
g_string_append_printf (where, "?%s a nao:Tag ; nao:prefLabel \"%s\" .\n", var, escaped);
g_free (var);
......@@ -492,11 +488,6 @@ read_metadata (TrackerSparqlBuilder *preupdate,
g_free (gd.comment);
}
if (where != NULL) {
tracker_sparql_builder_append (metadata, where->str);
g_string_free (where, TRUE);
}
tracker_xmp_free (xd);
}
......@@ -505,7 +496,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
goffset size;
GifFileType *gifFile = NULL;
......@@ -530,7 +522,7 @@ tracker_extract_get_metadata (const gchar *uri,
tracker_sparql_builder_object (metadata, "nfo:Image");
tracker_sparql_builder_object (metadata, "nmm:Photo");
read_metadata (preupdate, metadata, gifFile, uri);
read_metadata (preupdate, metadata, where, gifFile, uri);
if (DGifCloseFile (gifFile) != GIF_OK) {
PrintGifError ();
......
......@@ -845,7 +845,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
if (g_str_has_prefix (mimetype, "audio/")) {
tracker_extract_gstreamer_helix (uri, preupdate, metadata, EXTRACT_MIME_AUDIO);
......
......@@ -1322,7 +1322,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
if (strcmp (mimetype, "image/svg+xml") == 0) {
tracker_extract_gstreamer (uri, preupdate, metadata, EXTRACT_MIME_SVG);
......
......@@ -819,7 +819,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
if (strcmp (mimetype, "video/3gpp") == 0 ||
strcmp (mimetype, "video/mp4") == 0 ||
......
......@@ -234,7 +234,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
TrackerConfig *config;
htmlDocPtr doc;
......
......@@ -128,7 +128,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
guint max_width;
guint max_height;
......
......@@ -94,7 +94,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
struct jpeg_decompress_struct cinfo;
struct tej_error_mgr tejerr;
......@@ -110,7 +111,6 @@ tracker_extract_get_metadata (const gchar *uri,
GPtrArray *keywords;
gboolean success = TRUE;
guint i;
GString *where = NULL;
filename = g_filename_from_uri (uri, NULL, NULL);
......@@ -377,10 +377,6 @@ tracker_extract_get_metadata (const gchar *uri,
tracker_sparql_builder_predicate (metadata, "nao:hasTag");
tracker_sparql_builder_object_variable (metadata, var);
if (where == NULL) {
where = g_string_new ("} } WHERE { {\n");
}
g_string_append_printf (where, "?%s a nao:Tag ; nao:prefLabel \"%s\" .\n", var, escaped);
g_free (var);
......@@ -633,11 +629,6 @@ tracker_extract_get_metadata (const gchar *uri,
tracker_sparql_builder_object_double (metadata, value);
}
if (where != NULL) {
tracker_sparql_builder_append (metadata, where->str);
g_string_free (where, TRUE);
}
jpeg_destroy_decompress (&cinfo);
tracker_exif_free (ed);
......
......@@ -32,7 +32,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
xine_t *xine_base;
xine_audio_port_t *audio_port;
......
......@@ -2006,7 +2006,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
gchar *filename;
int fd;
......
......@@ -104,7 +104,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
gchar *argv[10];
gchar *mplayer;
......
......@@ -710,7 +710,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
MsOfficeXMLParserInfo info;
MsOfficeXMLFileType file_type;
......
......@@ -1635,7 +1635,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mime_used,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
TrackerConfig *config;
GsfInfile *infile = NULL;
......
......@@ -160,7 +160,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mime_used,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
TrackerConfig *config;
ODTMetadataParseInfo info;
......
......@@ -269,7 +269,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
TrackerConfig *config;
GTime creation_date;
......@@ -283,7 +284,6 @@ tracker_extract_get_metadata (const gchar *uri,
guint n_bytes;
GPtrArray *keywords;
guint i;
GString *where = NULL;
g_type_init ();
......@@ -583,10 +583,6 @@ tracker_extract_get_metadata (const gchar *uri,
tracker_sparql_builder_predicate (metadata, "nao:hasTag");
tracker_sparql_builder_object_variable (metadata, var);
if (where == NULL) {
where = g_string_new ("} } WHERE { {\n");
}
g_string_append_printf (where, "?%s a nao:Tag ; nao:prefLabel \"%s\" .\n", var, escaped);
g_free (var);
......@@ -610,11 +606,6 @@ tracker_extract_get_metadata (const gchar *uri,
read_outline (document, metadata);
if (where != NULL) {
tracker_sparql_builder_append (metadata, where->str);
g_string_free (where, TRUE);
}
g_free (xml);
g_free (pd.keywords);
g_free (pd.title);
......
......@@ -96,7 +96,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
TotemPlParser *pl;
TotemPlParserResult result;
......
......@@ -81,6 +81,7 @@ rfc1123_to_iso8601_date (const gchar *date)
static void
read_metadata (TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata,
GString *where,
png_structp png_ptr,
png_infop info_ptr,
png_infop end_ptr,
......@@ -97,7 +98,6 @@ read_metadata (TrackerSparqlBuilder *preupdate,
gint i;
gint found;
GPtrArray *keywords;
GString *where = NULL;
info_ptrs[0] = info_ptr;
info_ptrs[1] = end_ptr;
......@@ -496,10 +496,6 @@ read_metadata (TrackerSparqlBuilder *preupdate,
tracker_sparql_builder_predicate (metadata, "nao:hasTag");
tracker_sparql_builder_object_variable (metadata, var);
if (where == NULL) {
where = g_string_new ("} } WHERE { {\n");
}
g_string_append_printf (where, "?%s a nao:Tag ; nao:prefLabel \"%s\" .\n", var, escaped);
g_free (var);
......@@ -508,11 +504,6 @@ read_metadata (TrackerSparqlBuilder *preupdate,
}
g_ptr_array_free (keywords, TRUE);
if (where != NULL) {
tracker_sparql_builder_append (metadata, where->str);
g_string_free (where, TRUE);
}
tracker_exif_free (ed);
tracker_xmp_free (xd);
g_free (pd.creation_time);
......@@ -522,7 +513,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
goffset size;
FILE *f;
......@@ -620,7 +612,7 @@ tracker_extract_get_metadata (const gchar *uri,
tracker_sparql_builder_object (metadata, "nfo:Image");
tracker_sparql_builder_object (metadata, "nmm:Photo");
read_metadata (preupdate, metadata, png_ptr, info_ptr, end_ptr, uri);
read_metadata (preupdate, metadata, where, png_ptr, info_ptr, end_ptr, uri);
tracker_sparql_builder_predicate (metadata, "nfo:width");
tracker_sparql_builder_object_int64 (metadata, width);
......
......@@ -282,7 +282,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
#ifdef USING_UNZIPPSFILES
if (strcmp (mimetype, "application/x-gzpostscript") == 0) {
......
......@@ -76,7 +76,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
TrackerConfig *config;
gchar *content;
......
......@@ -243,7 +243,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
TIFF *image;
TrackerXmpData *xd = NULL;
......@@ -256,7 +257,6 @@ tracker_extract_get_metadata (const gchar *uri,
glong exif_offset;
GPtrArray *keywords;
guint i;
GString *where = NULL;
#ifdef HAVE_LIBIPTCDATA
gchar *iptc_offset;
......@@ -550,10 +550,6 @@ tracker_extract_get_metadata (const gchar *uri,
tracker_sparql_builder_predicate (metadata, "nao:hasTag");
tracker_sparql_builder_object_variable (metadata, var);
if (where == NULL) {
where = g_string_new ("} } WHERE { {\n");
}
g_string_append_printf (where, "?%s a nao:Tag ; nao:prefLabel \"%s\" .\n", var, escaped);
g_free (var);
......@@ -719,11 +715,6 @@ tracker_extract_get_metadata (const gchar *uri,
tracker_sparql_builder_object_double (metadata, value);
}
if (where != NULL) {
tracker_sparql_builder_append (metadata, where->str);
g_string_free (where, TRUE);
}
tiff_data_free (&td);
tracker_exif_free (ed);
tracker_xmp_free (xd);
......
......@@ -59,7 +59,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
gchar *argv[3];
gchar *totem;
......
......@@ -89,7 +89,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const char *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
VorbisData vd = { 0 };
MergeData md = { 0 };
......
......@@ -123,7 +123,8 @@ G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (const gchar *uri,
const gchar *mimetype,
TrackerSparqlBuilder *preupdate,
TrackerSparqlBuilder *metadata)
TrackerSparqlBuilder *metadata,
GString *where)
{
TrackerXmpData *xd = NULL;
GError *error = NULL;
......@@ -146,7 +147,7 @@ tracker_extract_get_metadata (const gchar *uri,
original_uri ? original_uri : uri);
if (xd) {
tracker_xmp_apply (preupdate, metadata, uri, xd);
tracker_xmp_apply (preupdate, metadata, where, uri, xd);
}
g_free (original_uri);
......
......@@ -57,6 +57,7 @@ static const gchar introspection_xml[] =
" <arg type='s' name='mime' direction='in' />"
" <arg type='s' name='preupdate' direction='out' />"
" <arg type='s' name='embedded' direction='out' />"
" <arg type='s' name='where' direction='out' />"
" </method>"
" <method name='GetMetadataFast'>"
" <arg type='s' name='uri' direction='in' />"
......@@ -209,10 +210,12 @@ get_file_metadata (TrackerExtract *extract,
const gchar *uri,
const gchar *mime,
TrackerSparqlBuilder **preupdate_out,
TrackerSparqlBuilder **statements_out)
TrackerSparqlBuilder **statements_out,
gchar **where_out)
{
TrackerExtractPrivate *priv;
TrackerSparqlBuilder *statements, *preupdate;
GString *where;
gchar *mime_used = NULL;
#ifdef HAVE_LIBSTREAMANALYZER
gchar *content_type = NULL;
......@@ -222,10 +225,12 @@ get_file_metadata (TrackerExtract *extract,
*preupdate_out = NULL;
*statements_out = NULL;
*where_out = NULL;
/* Create sparql builders to send back */
preupdate = tracker_sparql_builder_new_update ();
statements = tracker_sparql_builder_new_embedded_insert ();
where = g_string_new ("");
#ifdef HAVE_LIBSTREAMANALYZER
if (!priv->force_internal_extractors) {
......@@ -240,6 +245,7 @@ get_file_metadata (TrackerExtract *extract,
*preupdate_out = preupdate;
*statements_out = statements;
*where_out = g_string_free (where, FALSE);
return TRUE;
}
} else {
......@@ -271,6 +277,7 @@ get_file_metadata (TrackerExtract *extract,
uri);
g_object_unref (statements);
g_object_unref (preupdate);
g_string_free (where, TRUE);
return FALSE;
}
......@@ -293,6 +300,7 @@ get_file_metadata (TrackerExtract *extract,
g_object_unref (file);
g_object_unref (statements);
g_object_unref (preupdate);
g_string_free (where, TRUE);
return FALSE;
}
......@@ -321,7 +329,7 @@ get_file_metadata (TrackerExtract *extract,
StatisticsData *data;
gint items;
(func) (uri, mime_used, preupdate, statements);
(func) (uri, mime_used, preupdate, statements, where);
items = tracker_sparql_builder_get_length (statements);
......@@ -343,6 +351,7 @@ get_file_metadata (TrackerExtract *extract,
*preupdate_out = preupdate;
*statements_out = statements;
*where_out = g_string_free (where, FALSE);
return TRUE;
} else {
......@@ -367,6 +376,7 @@ get_file_metadata (TrackerExtract *extract,
*preupdate_out = preupdate;
*statements_out = statements;
*where_out = g_string_