Commit d93cbdaa authored by Carlos Garnacho's avatar Carlos Garnacho

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: GNOME/tracker-miners#60
parent ccd4c046
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment