[tracker-miners/wip/carlosg/extract-native-uris] tracker-extract: Avoid non-native URIs
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/extract-native-uris] tracker-extract: Avoid non-native URIs
- Date: Fri, 30 Oct 2020 12:44:06 +0000 (UTC)
commit 319930706c9700fb9325d6ca1bd20f815bc0a1e7
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Oct 30 13:25:38 2020 +0100
tracker-extract: Avoid non-native URIs
The tracker-extract-3 process is only meant to deal with native files.
Make it avoid non-native and other extraneous URIs, so we don't end
up breaking assumptions down the line.
Related: https://gitlab.gnome.org/GNOME/tracker-miners/-/issues/150
src/tracker-extract/tracker-extract-decorator.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/src/tracker-extract/tracker-extract-decorator.c b/src/tracker-extract/tracker-extract-decorator.c
index 9e6c1816b..b338168a6 100644
--- a/src/tracker-extract/tracker-extract-decorator.c
+++ b/src/tracker-extract/tracker-extract-decorator.c
@@ -251,6 +251,7 @@ decorator_next_item_cb (TrackerDecorator *decorator,
GError *error = NULL;
ExtractData *data;
GTask *task;
+ GFile *file;
priv = tracker_extract_decorator_get_instance_private (TRACKER_EXTRACT_DECORATOR (decorator));
info = tracker_decorator_next_finish (decorator, result, &error);
@@ -281,10 +282,21 @@ decorator_next_item_cb (TrackerDecorator *decorator,
return;
}
+ file = g_file_new_for_uri (tracker_decorator_info_get_url (info));
+
+ if (!g_file_is_native (file)) {
+ g_warning ("URI '%s' is not native",
+ tracker_decorator_info_get_url (info));
+ priv->n_extracting_files--;
+ tracker_decorator_info_unref (info);
+ decorator_get_next_file (decorator);
+ return;
+ }
+
data = g_new0 (ExtractData, 1);
data->decorator = decorator;
data->decorator_info = info;
- data->file = g_file_new_for_uri (tracker_decorator_info_get_url (info));
+ data->file = file;
task = tracker_decorator_info_get_task (info);
g_debug ("Extracting metadata for '%s'", tracker_decorator_info_get_url (info));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]