Index: libjuicer/sj-metadata-musicbrainz3.c
===================================================================
--- libjuicer/sj-metadata-musicbrainz3.c	(Revision 2509)
+++ libjuicer/sj-metadata-musicbrainz3.c	(Arbeitskopie)
@@ -44,6 +44,17 @@
 		field = g_strdup (buffer);					\
 }
 
+#define GET_ID(field, function, obj) {						\
+        function (obj, buffer, sizeof (buffer));				\
+	mb_extract_uuid (buffer, uuid_buffer, sizeof (uuid));			\
+	if (field)								\
+		g_free (field);							\
+	if (*uuid_buffer == '\0')						\
+		field = NULL;							\
+	else									\
+		field = g_strdup (uuid_buffer);					\
+}
+
 #define GCONF_PROXY_USE_PROXY "/system/http_proxy/use_http_proxy"
 #define GCONF_PROXY_HOST "/system/http_proxy/host"
 #define GCONF_PROXY_PORT "/system/http_proxy/port"
@@ -89,6 +100,7 @@
 {
   AlbumDetails *album;
   char buffer[512];
+  char uuid_buffer[37];
   MbArtist artist;
   char *new_title;
   int i;
@@ -97,15 +109,7 @@
 
   album = g_new0 (AlbumDetails, 1);
 
-   /* Some versions of libmusicbrainz3 seem to forget the trailing .html in the URL */
-  GET (album->album_id, mb_release_get_id, release);
-  if (album->album_id && g_str_has_suffix (album->album_id, ".html") == FALSE) {
-    char *tmp;
-    tmp = g_strdup_printf ("%s.html", album->album_id);
-    g_free (album->album_id);
-    album->album_id = tmp;
-  }
-
+  GET_ID (album->album_id, mb_release_get_id, release);
   GET (album->title, mb_release_get_title, release);
   new_title = sj_metadata_helper_scan_disc_number (album->title, &album->disc_number);
   if (new_title) {
@@ -167,7 +171,7 @@
     track->album = album;
 
     track->number = i + 1;
-    GET (track->track_id, mb_track_get_id, mbt);
+    GET_ID (track->track_id, mb_track_get_id, mbt);
 
     GET (track->title, mb_track_get_title, mbt);
     track->duration = mb_track_get_duration (mbt) / 1000;
@@ -175,7 +179,7 @@
     artist = mb_track_get_artist (mbt);
     if (artist == NULL)
       artist = mb_release_get_artist (release);
-    GET (track->artist_id, mb_artist_get_id, artist);
+    GET_ID (track->artist_id, mb_artist_get_id, artist);
     GET (track->artist, mb_artist_get_name, artist);
     GET (track->artist_sortname, mb_artist_get_sortname, artist);
 
