[sound-juicer] mb4: kill SjMb4TrackDetails



commit 6a40affe4d2492835689a30cb800ef0d66ff6ff0
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Sun Jan 8 20:38:11 2012 +0400

    mb4: kill SjMb4TrackDetails
    
    The only addition to TrackDetails was the artist list, which this
    commit adds to TrackDetails.

 libjuicer/sj-metadata-musicbrainz4.c |   20 ++------------------
 libjuicer/sj-structures.c            |    2 ++
 libjuicer/sj-structures.h            |    1 +
 3 files changed, 5 insertions(+), 18 deletions(-)
---
diff --git a/libjuicer/sj-metadata-musicbrainz4.c b/libjuicer/sj-metadata-musicbrainz4.c
index e77927e..573ef64 100644
--- a/libjuicer/sj-metadata-musicbrainz4.c
+++ b/libjuicer/sj-metadata-musicbrainz4.c
@@ -87,20 +87,6 @@ G_DEFINE_TYPE_WITH_CODE (SjMetadataMusicbrainz4,
 /*
  * Private methods
  */
-struct _SjMb4TrackDetails {
-    TrackDetails parent;
-    GList *artists;
-};
-typedef struct _SjMb4TrackDetails SjMb4TrackDetails;
-
-static void
-sj_mb4_track_details_free (SjMb4TrackDetails *details)
-{
-  g_list_foreach (details->artists, (GFunc)artist_details_free, NULL);
-  g_list_free (details->artists);
-  track_details_free ((TrackDetails *)details);
-}
-
 #ifdef DUMP_DETAILS
 static void
 sj_mb4_album_details_dump (AlbumDetails *details)
@@ -263,14 +249,12 @@ fill_tracks_from_medium (Mb4Medium medium, AlbumDetails *album)
     Mb4ArtistCredit credit;
     Mb4Recording recording;
     TrackDetails *track;
-    SjMb4TrackDetails *mb4_track;
 
     mbt = mb4_track_list_item (track_list, i);
     if (!mbt)
       continue;
 
-    mb4_track = g_new0 (SjMb4TrackDetails, 1);
-    track = &mb4_track->parent;
+    track = g_new0 (TrackDetails, 1);
 
     track->album = album;
 
@@ -295,7 +279,7 @@ fill_tracks_from_medium (Mb4Medium medium, AlbumDetails *album)
                          &track->artist_sortname,
                          &track->artist_id);
       }
-      mb4_track->artists = artists;
+      track->artists = artists;
     }
     if (track->artist == NULL)
       track->artist = g_strdup (album->artist);
diff --git a/libjuicer/sj-structures.c b/libjuicer/sj-structures.c
index 701ca4e..b4577d4 100644
--- a/libjuicer/sj-structures.c
+++ b/libjuicer/sj-structures.c
@@ -35,6 +35,8 @@ void track_details_free(TrackDetails *track)
   g_free (track->track_id);
   g_free (track->artist_id);
   g_free (track->artist_sortname);
+  g_list_foreach (track->artists, (GFunc)artist_details_free, NULL);
+
   g_free (track);
 }
 
diff --git a/libjuicer/sj-structures.h b/libjuicer/sj-structures.h
index da7fc58..46d67e9 100644
--- a/libjuicer/sj-structures.h
+++ b/libjuicer/sj-structures.h
@@ -49,6 +49,7 @@ struct _TrackDetails {
   int duration; /* seconds */
   char* track_id;
   char* artist_id;
+  GList *artists;
 };
 
 struct _AlbumDetails {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]