summaryrefslogtreecommitdiffstats
path: root/src/itdb_device.c
diff options
context:
space:
mode:
authorChristophe Fergeau <teuf@gnome.org>2007-10-07 11:33:30 +0000
committerChristophe Fergeau <teuf@gnome.org>2007-10-07 11:33:30 +0000
commitcbcbec11d55666e4ecc268e7ce70cf4c8b6c29dd (patch)
tree3e73ca8d96ce70c2c1636953c25e8706db08cfdc /src/itdb_device.c
parent968fcb7563fc24bf8c4bf4d5d3edb76c514d2e03 (diff)
downloadlibgpod-cbcbec11d55666e4ecc268e7ce70cf4c8b6c29dd.tar.gz
libgpod-cbcbec11d55666e4ecc268e7ce70cf4c8b6c29dd.tar.xz
libgpod-cbcbec11d55666e4ecc268e7ce70cf4c8b6c29dd.zip
* 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
Diffstat (limited to 'src/itdb_device.c')
-rw-r--r--src/itdb_device.c22
1 files changed, 22 insertions, 0 deletions
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;
+ }
+}