Index: rhythmdb/rhythmdb-private.h
===================================================================
--- rhythmdb/rhythmdb-private.h	(revision 4909)
+++ rhythmdb/rhythmdb-private.h	(working copy)
@@ -83,6 +83,10 @@
 	RBRefString *album;
 	RBRefString *genre;
 	RBRefString *musicbrainz_trackid;
+	RBRefString *musicbrainz_artistid;
+	RBRefString *musicbrainz_albumid;
+	RBRefString *musicbrainz_albumartistid;
+	RBRefString *musicbrainz_artistsortname;
 	gulong tracknum;
 	gulong discnum;
 	gulong duration;
Index: rhythmdb/rhythmdb-tree.c
===================================================================
--- rhythmdb/rhythmdb-tree.c	(revision 4909)
+++ rhythmdb/rhythmdb-tree.c	(working copy)
@@ -853,6 +853,18 @@
 		case RHYTHMDB_PROP_MUSICBRAINZ_TRACKID:
 			save_entry_string(ctx, elt_name, rb_refstring_get (entry->musicbrainz_trackid));
 			break;
+		case RHYTHMDB_PROP_MUSICBRAINZ_ARTISTID:
+			save_entry_string(ctx, elt_name, rb_refstring_get (entry->musicbrainz_artistid));
+			break;
+		case RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID:
+			save_entry_string(ctx, elt_name, rb_refstring_get (entry->musicbrainz_albumid));
+			break;
+		case RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID:
+			save_entry_string(ctx, elt_name, rb_refstring_get (entry->musicbrainz_albumartistid));
+			break;
+		case RHYTHMDB_PROP_MUSICBRAINZ_ARTISTSORTNAME:
+			save_entry_string(ctx, elt_name, rb_refstring_get (entry->musicbrainz_artistsortname));
+			break;
 		case RHYTHMDB_PROP_TRACK_NUMBER:
 			save_entry_ulong (ctx, elt_name, entry->tracknum, FALSE);
 			break;
Index: rhythmdb/rhythmdb.c
===================================================================
--- rhythmdb/rhythmdb.c	(revision 4909)
+++ rhythmdb/rhythmdb.c	(working copy)
@@ -335,6 +335,18 @@
 	case RHYTHMDB_PROP_MUSICBRAINZ_TRACKID:
 		*field = RB_METADATA_FIELD_MUSICBRAINZ_TRACKID;
 		return TRUE;
+	case RHYTHMDB_PROP_MUSICBRAINZ_ARTISTID:
+		*field = RB_METADATA_FIELD_MUSICBRAINZ_ARTISTID;
+		return TRUE;
+	case RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID:
+		*field = RB_METADATA_FIELD_MUSICBRAINZ_ALBUMID;
+		return TRUE;
+	case RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID:
+		*field = RB_METADATA_FIELD_MUSICBRAINZ_ALBUMARTISTID;
+		return TRUE;
+	case RHYTHMDB_PROP_MUSICBRAINZ_ARTISTSORTNAME:
+		*field = RB_METADATA_FIELD_MUSICBRAINZ_ARTISTSORTNAME;
+		return TRUE;
 	default:
 		return FALSE;
 	}
@@ -1133,6 +1145,10 @@
 	ret->artist = rb_refstring_ref (db->priv->empty_string);
 	ret->album = rb_refstring_ref (db->priv->empty_string);
 	ret->musicbrainz_trackid = rb_refstring_ref (db->priv->empty_string);
+	ret->musicbrainz_artistid = rb_refstring_ref (db->priv->empty_string);
+	ret->musicbrainz_albumid = rb_refstring_ref (db->priv->empty_string);
+	ret->musicbrainz_albumartistid = rb_refstring_ref (db->priv->empty_string);
+	ret->musicbrainz_artistsortname = rb_refstring_ref (db->priv->empty_string);
 	ret->mimetype = rb_refstring_ref (db->priv->octet_stream_str);
 
 	ret->flags |= RHYTHMDB_ENTRY_LAST_PLAYED_DIRTY |
@@ -1308,6 +1324,10 @@
 	rb_refstring_unref (entry->artist);
 	rb_refstring_unref (entry->album);
 	rb_refstring_unref (entry->musicbrainz_trackid);
+	rb_refstring_unref (entry->musicbrainz_artistid);
+	rb_refstring_unref (entry->musicbrainz_albumid);
+	rb_refstring_unref (entry->musicbrainz_albumartistid);
+	rb_refstring_unref (entry->musicbrainz_artistsortname);
 	rb_refstring_unref (entry->mimetype);
 
 	g_free (entry);
@@ -1460,6 +1480,42 @@
 		g_value_unset (&val);
 	}
 
+	/* musicbrainz artistid */
+	if (rb_metadata_get (metadata,
+			     RB_METADATA_FIELD_MUSICBRAINZ_ARTISTID,
+			     &val)) {
+		rhythmdb_entry_set_internal (db, entry, TRUE,
+					     RHYTHMDB_PROP_MUSICBRAINZ_ARTISTID, &val);
+		g_value_unset (&val);
+	}
+
+	/* musicbrainz albumid */
+	if (rb_metadata_get (metadata,
+			     RB_METADATA_FIELD_MUSICBRAINZ_ALBUMID,
+			     &val)) {
+		rhythmdb_entry_set_internal (db, entry, TRUE,
+					     RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID, &val);
+		g_value_unset (&val);
+	}
+
+	/* musicbrainz albumartistid */
+	if (rb_metadata_get (metadata,
+			     RB_METADATA_FIELD_MUSICBRAINZ_ALBUMARTISTID,
+			     &val)) {
+		rhythmdb_entry_set_internal (db, entry, TRUE,
+					     RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID, &val);
+		g_value_unset (&val);
+	}
+
+	/* musicbrainz artistsortname */
+	if (rb_metadata_get (metadata,
+			     RB_METADATA_FIELD_MUSICBRAINZ_ARTISTSORTNAME,
+			     &val)) {
+		rhythmdb_entry_set_internal (db, entry, TRUE,
+					     RHYTHMDB_PROP_MUSICBRAINZ_ARTISTSORTNAME, &val);
+		g_value_unset (&val);
+	}
+
 	/* filesize */
 	g_value_init (&val, G_TYPE_UINT64);
 	g_value_set_uint64 (&val, vfsinfo->size);
@@ -2846,6 +2902,22 @@
 			rb_refstring_unref (entry->musicbrainz_trackid);
 			entry->musicbrainz_trackid = rb_refstring_new (g_value_get_string (value));
 			break;
+		case RHYTHMDB_PROP_MUSICBRAINZ_ARTISTID:
+			rb_refstring_unref (entry->musicbrainz_artistid);
+			entry->musicbrainz_artistid = rb_refstring_new (g_value_get_string (value));
+			break;
+		case RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID:
+			rb_refstring_unref (entry->musicbrainz_albumid);
+			entry->musicbrainz_albumid = rb_refstring_new (g_value_get_string (value));
+			break;
+		case RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID:
+			rb_refstring_unref (entry->musicbrainz_albumartistid);
+			entry->musicbrainz_albumartistid = rb_refstring_new (g_value_get_string (value));
+			break;
+		case RHYTHMDB_PROP_MUSICBRAINZ_ARTISTSORTNAME:
+			rb_refstring_unref (entry->musicbrainz_artistsortname);
+			entry->musicbrainz_artistsortname = rb_refstring_new (g_value_get_string (value));
+			break;
 		case RHYTHMDB_PROP_HIDDEN:
 			if (g_value_get_boolean (value)) {
 				entry->flags |= RHYTHMDB_ENTRY_HIDDEN;
@@ -3572,6 +3644,10 @@
 			ENUM_ENTRY (RHYTHMDB_PROP_TRACK_NUMBER, "Track Number (gulong) [track-number]"),
 			ENUM_ENTRY (RHYTHMDB_PROP_DISC_NUMBER, "Disc Number (gulong) [disc-number]"),
 			ENUM_ENTRY (RHYTHMDB_PROP_MUSICBRAINZ_TRACKID, "Musicbrainz Track ID (gchararray) [mb-trackid]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_MUSICBRAINZ_ARTISTID, "Musicbrainz Artist ID (gchararray) [mb-artistid]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID, "Musicbrainz Album ID (gchararray) [mb-albumid]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID, "Musicbrainz Album Artist ID (gchararray) [mb-albumartistid]"),
+			ENUM_ENTRY (RHYTHMDB_PROP_MUSICBRAINZ_ARTISTSORTNAME, "Musicbrainz Artist Sortname (gchararray) [mb-artistsortname]"),
 
 			ENUM_ENTRY (RHYTHMDB_PROP_DURATION, "Duration (gulong) [duration]"),
 			ENUM_ENTRY (RHYTHMDB_PROP_FILE_SIZE, "File Size (guint64) [file-size]"),
@@ -4305,6 +4381,14 @@
 		return rb_refstring_get (entry->genre);
 	case RHYTHMDB_PROP_MUSICBRAINZ_TRACKID:
 		return rb_refstring_get (entry->musicbrainz_trackid);
+	case RHYTHMDB_PROP_MUSICBRAINZ_ARTISTID:
+		return rb_refstring_get (entry->musicbrainz_artistid);
+	case RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID:
+		return rb_refstring_get (entry->musicbrainz_albumid);
+	case RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID:
+		return rb_refstring_get (entry->musicbrainz_albumartistid);
+	case RHYTHMDB_PROP_MUSICBRAINZ_ARTISTSORTNAME:
+		return rb_refstring_get (entry->musicbrainz_artistsortname);
 	case RHYTHMDB_PROP_MIMETYPE:
 		return rb_refstring_get (entry->mimetype);
 	case RHYTHMDB_PROP_TITLE_SORT_KEY:
@@ -4395,6 +4479,14 @@
 		return rb_refstring_ref (entry->genre);
 	case RHYTHMDB_PROP_MUSICBRAINZ_TRACKID:
 		return rb_refstring_ref (entry->musicbrainz_trackid);
+	case RHYTHMDB_PROP_MUSICBRAINZ_ARTISTID:
+		return rb_refstring_ref (entry->musicbrainz_artistid);
+	case RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID:
+		return rb_refstring_ref (entry->musicbrainz_albumid);
+	case RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID:
+		return rb_refstring_ref (entry->musicbrainz_albumartistid);
+	case RHYTHMDB_PROP_MUSICBRAINZ_ARTISTSORTNAME:
+		return rb_refstring_ref (entry->musicbrainz_artistsortname);
 	case RHYTHMDB_PROP_MIMETYPE:
 		return rb_refstring_ref (entry->mimetype);
 	case RHYTHMDB_PROP_MOUNTPOINT:
Index: rhythmdb/rhythmdb.h
===================================================================
--- rhythmdb/rhythmdb.h	(revision 4909)
+++ rhythmdb/rhythmdb.h	(working copy)
@@ -195,6 +195,10 @@
 	RHYTHMDB_PROP_POST_TIME,
 
 	RHYTHMDB_PROP_MUSICBRAINZ_TRACKID,
+	RHYTHMDB_PROP_MUSICBRAINZ_ARTISTID,
+	RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID,
+	RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID,
+	RHYTHMDB_PROP_MUSICBRAINZ_ARTISTSORTNAME,
 
 	RHYTHMDB_NUM_PROPERTIES
 } RhythmDBPropType;
Index: backends/gstreamer/rb-encoder-gst.c
===================================================================
--- backends/gstreamer/rb-encoder-gst.c	(revision 4909)
+++ backends/gstreamer/rb-encoder-gst.c	(working copy)
@@ -484,6 +484,26 @@
 				  GST_TAG_MUSICBRAINZ_TRACKID, rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MUSICBRAINZ_TRACKID),
 				  NULL);
 	}
+	if (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MUSICBRAINZ_ARTISTID)) {
+		gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
+				  GST_TAG_MUSICBRAINZ_ARTISTID, rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MUSICBRAINZ_ARTISTID),
+				  NULL);
+	}
+	if (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID)) {
+		gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
+				  GST_TAG_MUSICBRAINZ_ALBUMID, rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID),
+				  NULL);
+	}
+	if (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID)) {
+		gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
+				  GST_TAG_MUSICBRAINZ_ALBUMARTISTID, rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID),
+				  NULL);
+	}
+	if (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MUSICBRAINZ_ARTISTSORTNAME)) {
+		gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
+				  GST_TAG_MUSICBRAINZ_SORTNAME, rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MUSICBRAINZ_ARTISTSORTNAME),
+				  NULL);
+	}
 #endif
 
 #ifdef HAVE_GSTREAMER_0_10
Index: metadata/rb-metadata.h
===================================================================
--- metadata/rb-metadata.h	(revision 4909)
+++ metadata/rb-metadata.h	(working copy)
@@ -57,6 +57,10 @@
 	RB_METADATA_FIELD_ALBUM_PEAK,		   /* double */
 	RB_METADATA_FIELD_LANGUAGE_CODE,	   /* string */
 	RB_METADATA_FIELD_MUSICBRAINZ_TRACKID,     /* string */
+	RB_METADATA_FIELD_MUSICBRAINZ_ARTISTID,    /* string */
+	RB_METADATA_FIELD_MUSICBRAINZ_ALBUMID,     /* string */
+	RB_METADATA_FIELD_MUSICBRAINZ_ALBUMARTISTID,   /* string */
+	RB_METADATA_FIELD_MUSICBRAINZ_ARTISTSORTNAME,  /* string */
 
 	RB_METADATA_FIELD_LAST			   /* nothing */
 } RBMetaDataField;
Index: metadata/rb-metadata-common.c
===================================================================
--- metadata/rb-metadata-common.c	(revision 4909)
+++ metadata/rb-metadata-common.c	(working copy)
@@ -61,7 +61,12 @@
 	/* RB_METADATA_FIELD_ALBUM_GAIN */ 		{ G_TYPE_DOUBLE, "replaygain-album-gain" },
 	/* RB_METADATA_FIELD_ALBUM_PEAK */ 		{ G_TYPE_DOUBLE, "replaygain-album-peak" },
 	/* RB_METADATA_FIELD_LANGUAGE_CODE */		{ G_TYPE_STRING, "language-code" },
-	/* RB_METADATA_FIELD_MUSICBRAINZ-TRACKID */	{ G_TYPE_STRING, "musicbrainz-trackid" }
+	/* RB_METADATA_FIELD_MUSICBRAINZ_TRACKID */	{ G_TYPE_STRING, "musicbrainz-trackid" },
+	/* RB_METADATA_FIELD_MUSICBRAINZ_ARTISTID */	{ G_TYPE_STRING, "musicbrainz-artistid" },
+	/* RB_METADATA_FIELD_MUSICBRAINZ_ALBUMID */	{ G_TYPE_STRING, "musicbrainz-albumid" },
+	/* RB_METADATA_FIELD_MUSICBRAINZ_ALBUMARTISTID */ { G_TYPE_STRING, "musicbrainz-albumartistid" },
+	/* RB_METADATA_FIELD_MUSICBRAINZ_ARTISTSORTNAME */ { G_TYPE_STRING, "musicbrainz-sortname" }
+
 };
 
 GType
Index: metadata/rb-metadata-gst.c
===================================================================
--- metadata/rb-metadata-gst.c	(revision 4909)
+++ metadata/rb-metadata-gst.c	(working copy)
@@ -515,6 +516,15 @@
 #ifdef GST_TAG_MUSICBRAINZ_TRACKID
 	else if (!strcmp (tag, GST_TAG_MUSICBRAINZ_TRACKID))
 		return RB_METADATA_FIELD_MUSICBRAINZ_TRACKID;
+	else if (!strcmp (tag, GST_TAG_MUSICBRAINZ_ARTISTID))
+		return RB_METADATA_FIELD_MUSICBRAINZ_ARTISTID;
+	else if (!strcmp (tag, GST_TAG_MUSICBRAINZ_ALBUMID))
+		return RB_METADATA_FIELD_MUSICBRAINZ_ALBUMID;
+	else if (!strcmp (tag, GST_TAG_MUSICBRAINZ_ALBUMARTISTID))
+		return RB_METADATA_FIELD_MUSICBRAINZ_ALBUMARTISTID;
+	else if (!strcmp (tag, GST_TAG_MUSICBRAINZ_SORTNAME))
+		return RB_METADATA_FIELD_MUSICBRAINZ_ARTISTSORTNAME;
+
 #endif
 	else
 		return -1;
@@ -578,6 +588,14 @@
 #ifdef GST_TAG_MUSICBRAINZ_TRACKID
 	case RB_METADATA_FIELD_MUSICBRAINZ_TRACKID:
 		return GST_TAG_MUSICBRAINZ_TRACKID;
+	case RB_METADATA_FIELD_MUSICBRAINZ_ARTISTID:
+		return GST_TAG_MUSICBRAINZ_ARTISTID;
+	case RB_METADATA_FIELD_MUSICBRAINZ_ALBUMID:
+		return GST_TAG_MUSICBRAINZ_ALBUMID;
+	case RB_METADATA_FIELD_MUSICBRAINZ_ALBUMARTISTID:
+		return GST_TAG_MUSICBRAINZ_ALBUMARTISTID;
+	case RB_METADATA_FIELD_MUSICBRAINZ_ARTISTSORTNAME:
+		return GST_TAG_MUSICBRAINZ_SORTNAME;
 #endif
 	default:
 		return NULL;
Index: plugins/audiocd/rb-audiocd-source.c
===================================================================
--- plugins/audiocd/rb-audiocd-source.c	(revision 4909)
+++ plugins/audiocd/rb-audiocd-source.c	(working copy)
@@ -563,12 +563,23 @@
 
 		rb_debug ("storing metadata for %s - %s - %s", track->artist, album->title, track->title);
 
+		rb_debug ("genre: %s", album->genre);
+		rb_debug ("musicbrainz_trackid: %s", track->track_id);
+		rb_debug ("musicbrainz_artistid: %s", track->artist_id);
+		rb_debug ("musicbrainz_albumid: %s", album->album_id);
+		rb_debug ("musicbrainz_albumartistid: %s", album->artist_id);
+		rb_debug ("musicbrainz_sortname: %s", album->artist_sortname);
+
 		/* record track info in entry*/
 		entry_set_string_prop (db, entry, TRUE, RHYTHMDB_PROP_TITLE, track->title);
 		entry_set_string_prop (db, entry, TRUE, RHYTHMDB_PROP_ARTIST, track->artist);
 		entry_set_string_prop (db, entry, TRUE, RHYTHMDB_PROP_ALBUM, album->title);
 		entry_set_string_prop (db, entry, TRUE, RHYTHMDB_PROP_GENRE, album->genre);
 		entry_set_string_prop (db, entry, TRUE, RHYTHMDB_PROP_MUSICBRAINZ_TRACKID, track->track_id);
+		entry_set_string_prop (db, entry, TRUE, RHYTHMDB_PROP_MUSICBRAINZ_ARTISTID, track->artist_id);
+		entry_set_string_prop (db, entry, TRUE, RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID, album->album_id);
+		entry_set_string_prop (db, entry, TRUE, RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID, album->artist_id);
+		entry_set_string_prop (db, entry, TRUE, RHYTHMDB_PROP_MUSICBRAINZ_ARTISTSORTNAME, album->artist_sortname);
 
 		g_value_init (&value, G_TYPE_ULONG);
 		g_value_set_ulong (&value, track->duration);
