From fad5dff9da900de68e287c5a3fe214f907ad90e6 Mon Sep 17 00:00:00 2001 From: jcsjcs Date: Wed, 28 May 2008 13:31:53 +0000 Subject: * src/itdb_track.c (itdb_track_set_thumbnails_internal): set artwork ID to 0 after removing thumbnails. * src/db-artwork-parser.c (parse_mhii): move out dbid association to a separate function. (mhfd_associate_itunesdb_artwork): handle dbid and mhii_link association of artwork to track (parse_mhfd): loop over the number of mhsd hunks instead of hardcoding it. Call mhfd_associate_itunesdb_artwork(). * src/itdb_itunesdb.c (get_mhit): read the mhii_link field. * src/db-artwork-writer.c (write_mhli): handle unset artwork correctly. (itdb_track_filter_thumbnails): remove thumbnails correctly. * src/db-parse-context.c (db_parse_context_get_sub_context): copy newly introduced artwork field. * tests/test-covers.c: print mhii_link. * src/itdb.h: (Itdb_Track) added mhii_link. (Itdb_Artwork): added dbid. * src/itdb.h, src/db-artwork-parser.c, src/db-artwork-writer.c, src/itdb_device.c, src/ithumb-writer.c, src/itdb_artwork.c: added ITDB_THUMB_CHAPTER_SMALL/LARGE. * src/itdb_device.c: ipod_classic_1_artwork_info: correct ITDB_THUMB_COVER_SMALL/LARGE entries. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1985 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- src/itdb_track.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/itdb_track.c') diff --git a/src/itdb_track.c b/src/itdb_track.c index 470f92d..c09b9ae 100644 --- a/src/itdb_track.c +++ b/src/itdb_track.c @@ -395,14 +395,13 @@ static gboolean itdb_track_set_thumbnails_internal (Itdb_Track *track, gpointer *pixbuf, gint rotation, GError **error) -{ - /* FIXME: this looks like it would work, but the problem is that - * gtkpod calls this function mostly with tracks that are not yet - * part of an iTunesDB. This means only the SMALL and LARGE thumbs - * are being added. +{ + /* gtkpod calls this function mostly with tracks that are not yet + * part of an iTunesDB. This means it is not known which + * thumbnails are required. * - * One solution would be to add all kinds of cover thumbs and weed - * out the ones not supported when the ArtworkDB is written. + * Our solution is to add all kinds of cover thumbs and weed out + * the ones not supported when the ArtworkDB is written. * * Suggestions welcome! */ @@ -428,6 +427,8 @@ static gboolean itdb_track_set_thumbnails_internal (Itdb_Track *track, } itdb_artwork_remove_thumbnails (track->artwork); + /* clear artwork id */ + track->artwork->id = 0; for (thumbtype=thumbtypes; *thumbtype!=-1; ++thumbtype) { -- cgit