diff options
author | Christophe Fergeau <teuf@gnome.org> | 2008-06-09 19:53:36 +0000 |
---|---|---|
committer | Christophe Fergeau <teuf@gnome.org> | 2008-06-09 19:53:36 +0000 |
commit | 3f2830dc026ba5211504261513a74855ccbb098f (patch) | |
tree | 1261fe601c0fdc543ca024404b6107245d3d4ead /src/ithumb-writer.c | |
parent | 0a03e8911c53136dd3e17faf2e37aa895285a341 (diff) | |
download | libgpod-tmz-3f2830dc026ba5211504261513a74855ccbb098f.tar.gz libgpod-tmz-3f2830dc026ba5211504261513a74855ccbb098f.tar.xz libgpod-tmz-3f2830dc026ba5211504261513a74855ccbb098f.zip |
* src/db-artwork-parser.c: remove duplicated artwork/photo support
testing functions
* src/db-artwork-parser.h: ditto
* src/itdb_itunesdb.c: s/ipod_supports_XXX/itdb_device_supports_XXX
* src/itdb_photoalbum.c: ditto
* src/itdb.h: use a const Itdb_Device argument for
itdb_device_supports_*, add ITDB_IPOD_GENERATION_IPHONE_1 to
Itdb_IpodGeneration, get rid of ITDB_IPOD_GENERATION_FIFTH and
ITDB_IPOD_GENERATION_SIXTH
* src/itdb_device.c: split functions to get artwork format from the
ipod in 2 separate functions: instead of
itdb_device_get_artwork_formats we now have
itdb_device_get_photo_formats and itdb_device_get_cover_art_formats
* src/itdb_device.h:
* src/db-image-parser.c: use the separate
get_cover_art_formats/get_photos_formats functions
* src/db-artwork-writer.c: ditto
* src/ithumb-writer.c: ditto
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2009 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/ithumb-writer.c')
-rw-r--r-- | src/ithumb-writer.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/ithumb-writer.c b/src/ithumb-writer.c index a5629c3..83c9bff 100644 --- a/src/ithumb-writer.c +++ b/src/ithumb-writer.c @@ -1395,9 +1395,9 @@ itdb_write_ithumb_files (Itdb_DB *db) { #ifdef HAVE_GDKPIXBUF GList *writers; - GList *it; Itdb_Device *device; - const Itdb_ArtworkFormat *format; + GList *formats; + GList *it; const gchar *mount_point; g_return_val_if_fail (db, -1); @@ -1410,26 +1410,27 @@ itdb_write_ithumb_files (Itdb_DB *db) if (mount_point == NULL) return -1; - format = itdb_device_get_artwork_formats (device); - if (format == NULL) { - return -1; - } + formats = NULL; + switch (db->db_type) { + case DB_TYPE_ITUNES: + formats = itdb_device_get_cover_art_formats(db_get_device(db)); + break; + case DB_TYPE_PHOTO: + formats = itdb_device_get_photo_formats(db_get_device(db)); + break; + } writers = NULL; - while (format->type != -1) { + for (it = formats; it != NULL; it = it->next) { iThumbWriter *writer; - - if (itdb_thumb_type_is_valid_for_db (format, db->db_type)) - { - ithmb_rearrange_existing_thumbnails (db, format ); - writer = ithumb_writer_new (mount_point, - format, - db->db_type, - device->byte_order); - if (writer != NULL) { - writers = g_list_prepend (writers, writer); - } + const Itdb_ArtworkFormat *format; + + format = (const Itdb_ArtworkFormat *)it->data; + ithmb_rearrange_existing_thumbnails (db, format); + writer = ithumb_writer_new (mount_point, format, + db->db_type, device->byte_order); + if (writer != NULL) { + writers = g_list_prepend (writers, writer); } - format++; } if (writers == NULL) { return -1; |