summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSumaid Syed <sumaidsyed@gmail.com>2019-06-13 21:05:06 +0530
committerSumaid Syed <sumaidsyed@gmail.com>2019-06-14 13:23:54 +0530
commitd6fad8022b74e21c489ff8633535657b9cb474b3 (patch)
treed3bc912d2def7d751db448b260c64524a1867911 /src
parent3cb7f117d2fb6d61e487dbbfbba87318ef8ca072 (diff)
downloadgrilo-d6fad8022b74e21c489ff8633535657b9cb474b3.tar.gz
grl-metadata-key: Add metadata keys for MB Release ID and MB Release Group ID
A MusicBrainz release represents the unique release (i.e. issuing) of a product on a specific date with specific release information such as the country, label, barcode and packaging. A release group is used to group several different releases into a single logical entity. Add Grilo Media support for MusicBrainz release and release group identifiers. Deprecate use of album identifier since it could mean release or release group id. https://gitlab.gnome.org/GNOME/grilo/issues/136
Diffstat (limited to 'src')
-rw-r--r--src/data/grl-media.c64
-rw-r--r--src/data/grl-media.h8
-rw-r--r--src/grl-metadata-key.c20
-rw-r--r--src/grl-metadata-key.h2
4 files changed, 94 insertions, 0 deletions
diff --git a/src/data/grl-media.c b/src/data/grl-media.c
index 67358e4..5b1cb6a 100644
--- a/src/data/grl-media.c
+++ b/src/data/grl-media.c
@@ -1686,6 +1686,40 @@ grl_media_set_mb_album_id (GrlMedia *media, const gchar *mb_album_id)
}
/**
+ * grl_media_set_mb_release_id:
+ * @media: the media instance
+ * @mb_release_id: Album release identifier in MusicBrainz
+ *
+ * Set the MusicBrainz release identifier of the media
+ *
+ * Since: 0.3.8
+ */
+void
+grl_media_set_mb_release_id (GrlMedia *media, const gchar *mb_release_id)
+{
+ g_return_if_fail (GRL_IS_MEDIA (media));
+ grl_data_set_string (GRL_DATA (media), GRL_METADATA_KEY_MB_RELEASE_ID,
+ mb_release_id);
+}
+
+/**
+ * grl_media_set_mb_release_group_id:
+ * @media: the media instance
+ * @mb_release_group_id: Album group release identifier in MusicBrainz
+ *
+ * Set the MusicBrainz Release Group identifier of the media
+ *
+ * Since: 0.3.8
+ */
+void
+grl_media_set_mb_release_group_id (GrlMedia *media, const gchar *mb_release_group_id)
+{
+ g_return_if_fail (GRL_IS_MEDIA (media));
+ grl_data_set_string (GRL_DATA (media), GRL_METADATA_KEY_MB_RELEASE_GROUP_ID,
+ mb_release_group_id);
+}
+
+/**
* grl_media_set_lyrics:
* @media: the media instance
* @lyrics: the audio's lyrics
@@ -3065,6 +3099,36 @@ grl_media_get_mb_track_id (GrlMedia *media)
}
/**
+ * grl_media_get_mb_release_id:
+ * @media: the media instance
+ *
+ * Returns: the MusicBrainz release identifier of the media
+ *
+ * Since: 0.3.8
+ */
+const gchar *
+grl_media_get_mb_release_id (GrlMedia *media)
+{
+ g_return_val_if_fail (GRL_IS_MEDIA (media), NULL);
+ return grl_data_get_string (GRL_DATA (media), GRL_METADATA_KEY_MB_RELEASE_ID);
+}
+
+/**
+ * grl_media_get_mb_release_group_id:
+ * @media: the media instance
+ *
+ * Returns: the MusicBrainz release group identifier of the media
+ *
+ * Since: 0.3.8
+ */
+const gchar *
+grl_media_get_mb_release_group_id (GrlMedia *media)
+{
+ g_return_val_if_fail (GRL_IS_MEDIA (media), NULL);
+ return grl_data_get_string (GRL_DATA (media), GRL_METADATA_KEY_MB_RELEASE_GROUP_ID);
+}
+
+/**
* grl_media_get_lyrics:
* @media: the media instance
*
diff --git a/src/data/grl-media.h b/src/data/grl-media.h
index 8392e41..53a06a7 100644
--- a/src/data/grl-media.h
+++ b/src/data/grl-media.h
@@ -187,6 +187,10 @@ void grl_media_set_mb_artist_id (GrlMedia *media, const gchar *mb_artist_id);
void grl_media_set_mb_album_id (GrlMedia *media, const gchar *mb_album_id);
+void grl_media_set_mb_release_id (GrlMedia *media, const gchar *mb_release_id);
+
+void grl_media_set_mb_release_group_id (GrlMedia *media, const gchar *mb_release_group_id);
+
void grl_media_set_lyrics (GrlMedia *media, const gchar *lyrics);
void grl_media_set_genre (GrlMedia *media, const gchar *genre);
@@ -358,6 +362,10 @@ const gchar *grl_media_get_mb_recording_id (GrlMedia *media);
const gchar *grl_media_get_mb_track_id (GrlMedia *media);
+const gchar *grl_media_get_mb_release_id (GrlMedia *media);
+
+const gchar *grl_media_get_mb_release_group_id (GrlMedia *media);
+
const gchar *grl_media_get_lyrics (GrlMedia *media);
const gchar *grl_media_get_lyrics_nth (GrlMedia *media, guint index);
diff --git a/src/grl-metadata-key.c b/src/grl-metadata-key.c
index 99ba123..ce60105 100644
--- a/src/grl-metadata-key.c
+++ b/src/grl-metadata-key.c
@@ -649,6 +649,26 @@ grl_metadata_key_setup_system_keys (GrlRegistry *registry)
NULL);
grl_registry_register_metadata_key_system (registry,
+ g_param_spec_string ("mb-release-id",
+ "MusicBrainz Release Id",
+ "Album release identifier in MusicBrainz",
+ NULL,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE),
+ GRL_METADATA_KEY_MB_RELEASE_ID,
+ GRL_METADATA_KEY_INVALID,
+ NULL);
+
+ grl_registry_register_metadata_key_system (registry,
+ g_param_spec_string ("mb-release-group-id",
+ "MusicBrainz Release Group Id",
+ "Album release group identifier in MusicBrainz",
+ NULL,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE),
+ GRL_METADATA_KEY_MB_RELEASE_GROUP_ID,
+ GRL_METADATA_KEY_INVALID,
+ NULL);
+
+ grl_registry_register_metadata_key_system (registry,
g_param_spec_int ("audio-track",
"Audio track",
"Audio track to use within a media",
diff --git a/src/grl-metadata-key.h b/src/grl-metadata-key.h
index c5b8935..81429aa 100644
--- a/src/grl-metadata-key.h
+++ b/src/grl-metadata-key.h
@@ -125,6 +125,8 @@ typedef enum {
#define GRL_METADATA_KEY_ALBUM_DISC_NUMBER 58
#define GRL_METADATA_KEY_COMPOSER 59
#define GRL_METADATA_KEY_ALBUM_ARTIST 60
+#define GRL_METADATA_KEY_MB_RELEASE_ID 61
+#define GRL_METADATA_KEY_MB_RELEASE_GROUP_ID 62
/* END CORE KEYS */