-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from sailfishos/metadata_update_fixes
[tracker-miners] Fix nfo:fileName and nfo:fileLastModified updates. JB#55293 OMP#JOLLA-390
- Loading branch information
Showing
9 changed files
with
102 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
rpm/0003-Prevent-tracker-extract-failing-when-seccomp-loading.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
rpm/0004-Add-also-fileSize-to-the-basic-set-of-file-info-on-a.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
rpm/0005-Fix-database-corruption-caused-by-the-miner-being-re.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
rpm/0007-Update-nfo-fileName-on-content-specific-graphs-too-w.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
From 5765e58d901e6ac9e9b68f47390ef70e16f7dccc Mon Sep 17 00:00:00 2001 | ||
From: Pekka Vuorela <pekka.vuorela@jolla.com> | ||
Date: Tue, 21 Sep 2021 18:26:24 +0300 | ||
Subject: [PATCH 7/8] Update nfo:fileName on content specific graphs too when | ||
moved | ||
|
||
Moved files were updating nfo:fileName only in tracker:FileSystem. | ||
|
||
Fixes: https://gitlab.gnome.org/GNOME/tracker-miners/-/issues/194 | ||
--- | ||
src/miners/fs/tracker-miner-files.c | 4 +++- | ||
1 file changed, 3 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c | ||
index fb7b3152f..d1c1dc841 100644 | ||
--- a/src/miners/fs/tracker-miner-files.c | ||
+++ b/src/miners/fs/tracker-miner-files.c | ||
@@ -2423,14 +2423,16 @@ miner_files_move_file (TrackerMinerFS *fs, | ||
"} INSERT {" | ||
" GRAPH ?g {" | ||
" <%s> a nfo:FileDataObject ; " | ||
+ " nfo:fileName \"%s\" ; " | ||
" ?p ?o " | ||
" }" | ||
"} WHERE {" | ||
" GRAPH ?g {" | ||
" <%s> ?p ?o " | ||
" }" | ||
+ " FILTER (?p != nfo:fileName) . " | ||
"}", | ||
- source_uri, uri, source_uri); | ||
+ source_uri, uri, display_name, source_uri); | ||
g_free (container_clause); | ||
|
||
if (recursive) { | ||
-- | ||
2.31.1 | ||
|
49 changes: 49 additions & 0 deletions
49
rpm/0008-Update-nfo-fileLastModified-also-on-content-specific.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
From 3ca4979071a832aabddfb99b7f3933d6993f35c3 Mon Sep 17 00:00:00 2001 | ||
From: Pekka Vuorela <pekka.vuorela@jolla.com> | ||
Date: Tue, 21 Sep 2021 19:38:08 +0300 | ||
Subject: [PATCH 8/8] Update nfo:fileLastModified also on content specific | ||
graphs | ||
|
||
Executing 'touch' on a file was updating only tracker:FileSystem. | ||
--- | ||
src/miners/fs/tracker-miner-files.c | 12 +++++++++++- | ||
1 file changed, 11 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c | ||
index d1c1dc841..d886650e6 100644 | ||
--- a/src/miners/fs/tracker-miner-files.c | ||
+++ b/src/miners/fs/tracker-miner-files.c | ||
@@ -2190,9 +2190,10 @@ miner_files_process_file_attributes (TrackerMinerFS *fs, | ||
GFileInfo *info, | ||
TrackerSparqlBuffer *buffer) | ||
{ | ||
- TrackerResource *resource; | ||
+ TrackerResource *resource, *graph_file; | ||
time_t time_; | ||
gchar *uri, *time_str; | ||
+ const gchar *mime_type, *graph; | ||
GDateTime *modified; | ||
|
||
uri = g_file_get_uri (file); | ||
@@ -2210,9 +2211,18 @@ miner_files_process_file_attributes (TrackerMinerFS *fs, | ||
if (!modified) | ||
modified = g_date_time_new_from_unix_utc (0); | ||
|
||
+ mime_type = g_file_info_get_content_type (info); | ||
+ graph = tracker_extract_module_manager_get_graph (mime_type); | ||
+ | ||
/* Update nfo:fileLastModified */ | ||
time_str = g_date_time_format_iso8601 (modified); | ||
tracker_resource_set_string (resource, "nfo:fileLastModified", time_str); | ||
+ if (graph) { | ||
+ graph_file = tracker_resource_new (uri); | ||
+ tracker_resource_set_string (graph_file, "nfo:fileLastModified", time_str); | ||
+ tracker_sparql_buffer_push (buffer, file, graph, graph_file); | ||
+ g_clear_object (&graph_file); | ||
+ } | ||
g_date_time_unref (modified); | ||
g_free (time_str); | ||
|
||
-- | ||
2.31.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters