From cbcbec11d55666e4ecc268e7ce70cf4c8b6c29dd Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Sun, 7 Oct 2007 11:33:30 +0000 Subject: * src/itdb_device.c: (itdb_device_requires_checksum): * src/itdb_itunesdb.c: (write_db_checksum): * src/itdb_private.h: add an itdb_device_requires_checksum function so that we only error out because of checksum writing issues on ipods which require a checksum. Ideally, we should restore the old file when there is a fatal checksum writing error, but libgpod isn't currently doing that git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1722 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- src/itdb_device.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/itdb_device.c') diff --git a/src/itdb_device.c b/src/itdb_device.c index 62391db..b4c5584 100644 --- a/src/itdb_device.c +++ b/src/itdb_device.c @@ -1061,3 +1061,25 @@ guint64 itdb_device_get_firewire_id (Itdb_Device *device) } return g_ascii_strtoull (fwid, NULL, 16); } + +G_GNUC_INTERNAL gboolean itdb_device_requires_checksum (Itdb_Device *device) +{ + const Itdb_IpodInfo *info; + + if (device == NULL) { + return FALSE; + } + + info = itdb_device_get_ipod_info (device); + if (info == NULL) { + return FALSE; + } + switch (info->ipod_generation) { + case ITDB_IPOD_GENERATION_CLASSIC_1: + return TRUE; + case ITDB_IPOD_GENERATION_NANO_3: + return TRUE; + default: + return FALSE; + } +} -- cgit