summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2012-06-18 18:54:57 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2013-04-10 15:23:34 +0200
commitb2f6bce46d6ae2e9d6f14e85f6af86bbd1db323a (patch)
treec70e634a1e378b24335d1852b7f6a94ef7966dee
parent1566a708901e34f714f937af20270e61c237bcba (diff)
Add label to AlbumDetails.
To disambiguate between albums with the same disc ID it would be useful to display the recording label. NB musicbrainz provides a list of recording labels for each release. https://bugzilla.gnome.org/show_bug.cgi?id=674926
-rw-r--r--libjuicer/sj-structures.c11
-rw-r--r--libjuicer/sj-structures.h8
2 files changed, 18 insertions, 1 deletions
diff --git a/libjuicer/sj-structures.c b/libjuicer/sj-structures.c
index 3dc29c3..318a180 100644
--- a/libjuicer/sj-structures.c
+++ b/libjuicer/sj-structures.c
@@ -65,6 +65,7 @@ void album_details_free(AlbumDetails *album)
g_free (album->lyrics_url);
g_free (album->country);
g_free (album->type);
+ g_list_foreach (album->labels, (GFunc)label_details_free, NULL);
g_list_foreach (album->artists, (GFunc)artist_details_free, NULL);
g_list_free (album->artists);
g_free (album);
@@ -84,3 +85,13 @@ void artist_details_free (ArtistDetails *artist)
g_free (artist->joinphrase);
g_free (artist);
}
+
+/*
+ * Free a LabelDetails
+ */
+void label_details_free (LabelDetails *label)
+{
+ g_free (label->name);
+ g_free (label->sortname);
+ g_free (label);
+}
diff --git a/libjuicer/sj-structures.h b/libjuicer/sj-structures.h
index e2553f9..e97a76b 100644
--- a/libjuicer/sj-structures.h
+++ b/libjuicer/sj-structures.h
@@ -30,6 +30,7 @@ typedef enum _MetadataSource MetadataSource;
typedef struct _AlbumDetails AlbumDetails;
typedef struct _ArtistDetails ArtistDetails;
+typedef struct _LabelDetails LabelDetails;
typedef struct _TrackDetails TrackDetails;
enum _MetadataSource {
@@ -68,6 +69,7 @@ struct _AlbumDetails {
GDate *release_date; /* MusicBrainz support multiple releases per album */
char* album_id;
char* artist_id;
+ GList* labels;
char* asin;
char* discogs;
char* wikipedia;
@@ -96,9 +98,13 @@ struct _ArtistDetails {
char *joinphrase;
};
+struct _LabelDetails {
+ char *name;
+ char *sortname;
+};
void album_details_free(AlbumDetails *album);
void artist_details_free(ArtistDetails *artist);
+void label_details_free (LabelDetails *label);
void track_details_free(TrackDetails *track);
-
#endif