Commit afee86d7 authored by Sam Thursfield's avatar Sam Thursfield

Merge branch 'chroma_ogg' into 'master'

Extract AcoustID Fingerprint from vorbis files

See merge request GNOME/tracker-miners!79
parents 8498a9e9 b0daf678
......@@ -57,6 +57,7 @@ typedef struct {
gchar *codec_version;
gchar *sample_rate;
gchar *channels;
gchar *acoustid_fingerprint;
gchar *mb_release_id;
gchar *mb_release_group_id;
gchar *mb_track_id;
......@@ -148,6 +149,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
vd.codec_version = ogg_get_comment (comment, "CodecVersion");
vd.sample_rate = ogg_get_comment (comment, "SampleRate");
vd.channels = ogg_get_comment (comment, "Channels");
vd.acoustid_fingerprint = ogg_get_comment (comment, "ACOUSTID_FINGERPRINT");
vd.mb_release_id = ogg_get_comment (comment, "MUSICBRAINZ_ALBUMID");
vd.mb_release_group_id = ogg_get_comment (comment, "MUSICBRAINZ_RELEASEGROUPID");
vd.mb_artist_id = ogg_get_comment (comment, "MUSICBRAINZ_ARTISTID");
......@@ -283,6 +285,22 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
g_free (vd.channels);
}
if (vd.acoustid_fingerprint) {
TrackerResource *hash_resource;
hash_resource = tracker_resource_new (NULL);
tracker_resource_set_uri (hash_resource, "rdf:type", "nfo:FileHash");
tracker_resource_set_string (hash_resource, "nfo:hashValue", vd.acoustid_fingerprint);
tracker_resource_set_string (hash_resource, "nfo:hashAlgorithm", "chromaprint");
tracker_resource_set_relation (metadata, "nfo:hasHash", hash_resource);
g_object_unref (hash_resource);
g_free (vd.acoustid_fingerprint);
}
if (vd.mb_recording_id) {
tracker_resource_set_string (metadata, "nmm:mbRecordingID", vd.mb_recording_id);
g_free (vd.mb_recording_id);
......
......@@ -24,6 +24,11 @@
"nie:title": "SinCos",
"nmm:mbReleaseGroupID": "561234",
"nmm:mbReleaseID": "345612"
},
"nfo:hasHash": {
"@type": "nfo:hasHash",
"nfo:hashAlgorithm": "chromaprint",
"nfo:hashValue": "111222"
}
}
}
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