diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2011-08-01 21:57:53 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2012-01-13 00:26:49 +0100 |
commit | 1d5f15bf72371f9610a1dbb7781058af7e425599 (patch) | |
tree | 0e98efc447316d57693c770048ae422488fb86b4 /libjuicer | |
parent | 3a01cdb287d7a91d94b6b9988a281050cbc56881 (diff) |
mb4: remove use of GET_ID
In libmusicbrainz4, there are regular accessors for the ID every time
there is one available, so we can just use GET to get the various IDs
we need.
Diffstat (limited to 'libjuicer')
-rw-r--r-- | libjuicer/sj-metadata-musicbrainz4.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/libjuicer/sj-metadata-musicbrainz4.c b/libjuicer/sj-metadata-musicbrainz4.c index 8fd7f05..a40c938 100644 --- a/libjuicer/sj-metadata-musicbrainz4.c +++ b/libjuicer/sj-metadata-musicbrainz4.c @@ -46,26 +46,6 @@ field = g_strdup (buffer); \ } -#if HAVE_MB_EXTRACT_UUID -#define GET_ID(field, function, obj) { \ - char uuid_buffer[37]; \ - function (obj, buffer, sizeof (buffer)); \ - mb_extract_uuid (buffer, uuid_buffer, sizeof (uuid_buffer)); \ - if (field) \ - g_free (field); \ - if (*uuid_buffer == '\0') \ - field = NULL; \ - else \ - field = g_strdup (uuid_buffer); \ -} -#else -#define GET_ID(field, function, obj) { \ - if (field) \ - g_free (field); \ - field = NULL; \ -} -#endif /* HAVE_MB_EXTRACT_UUID */ - #define GCONF_MUSICBRAINZ_SERVER "/apps/sound-juicer/musicbrainz_server" #define GCONF_PROXY_USE_PROXY "/system/http_proxy/use_http_proxy" #define GCONF_PROXY_HOST "/system/http_proxy/host" @@ -220,7 +200,7 @@ get_artist_list (Mb4ArtistCredit credit) continue; } - GET_ID (details->id, mb4_artist_get_id, artist); + GET (details->id, mb4_artist_get_id, artist); GET (details->name, mb4_artist_get_name, artist); GET (details->sortname, mb4_artist_get_sortname, artist); GET (details->disambiguation, mb4_artist_get_disambiguation, artist); @@ -302,10 +282,10 @@ fill_tracks_from_medium (Mb4Medium medium, AlbumDetails *album) track->album = album; track->number = mb4_track_get_position (mbt); - GET_ID (track->track_id, mb_track_get_id, mbt); recording = mb4_track_get_recording (mbt); if (recording != NULL) { GET (track->title, mb4_recording_get_title, recording); + GET (track->track_id, mb4_recording_get_id, recording); track->duration = mb4_recording_get_length (recording) / 1000; credit = mb4_recording_get_artistcredit (recording); } else { @@ -355,7 +335,7 @@ make_album_from_release (Mb4Release release, Mb4Medium medium) mb4_album = g_new0 (SjMb4AlbumDetails, 1); album = &mb4_album->parent; - GET_ID (album->album_id, mb4_release_get_id, release); + GET (album->album_id, mb4_release_get_id, release); GET (album->title, mb4_medium_get_title, medium); if (album->title == NULL) GET (album->title, mb4_release_get_title, release); |