[tracker-miners/wip/carlosg/fix-gstreamer-toc] tracker-extract: Relate contained audio tracks and container file both ways
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/fix-gstreamer-toc] tracker-extract: Relate contained audio tracks and container file both ways
- Date: Sun, 31 Mar 2019 14:36:01 +0000 (UTC)
commit d93cbdaad019faa9e3ccdd1fdbf6da904cff1ce1
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Mar 31 15:41:11 2019 +0200
tracker-extract: Relate contained audio tracks and container file both ways
The migration to TrackerResource broke the handling of flac/cue, as
tracker_resource_print_*() do expect all related resources to be directly
referenced from the root resource, but the gstreamer extractor just added
backreferences from the nmm:MusicPieces to the parent nfo:FileDataObject.
Add a relation both ways through nie:hasLogicalPart/nie:isLogicalPartOf
so the graph is complete, and the tracks referenced from the root element.
Closes: https://gitlab.gnome.org/GNOME/tracker-miners/issues/60
src/tracker-extract/tracker-extract-gstreamer.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 3546069a6..0a1563f7c 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -892,7 +892,8 @@ extract_metadata (MetadataExtractor *extractor,
track = extract_track (extractor, node->data, file_url, album_disc);
tracker_resource_set_relation (track, "nie:isStoredAs", resource);
- g_object_unref (track);
+ tracker_resource_set_relation (track, "nie:isLogicalPartOf",
resource);
+ tracker_resource_add_take_relation (resource, "nie:hasLogicalPart",
track);
}
tracker_resource_set_string (resource, "nie:url", file_url);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]