From 0e14d36438eeb7ed8f39610267a1c78b7f98889f Mon Sep 17 00:00:00 2001 From: David Forrester Date: Wed, 19 Jun 2013 14:23:43 +1000 Subject: [PATCH] SQL delete needs firmware check for older Kobo firmare Kobo driver: Fix a regression when deleting empty shelves on Kobo devices with older firmware. Fixes #1192441 [Private bug](https://bugs.launchpad.net/calibre/+bug/1192441) As reported here, http://www.mobileread.com/forums/showthread.php?t=214760, if the Kobo device is using firmware before 2.5.0, it doesn't have the Activity table. The delete from this table when maintaining shelves needs a version check around it. --- src/calibre/devices/kobo/driver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index cddf6a561f..cb325efb07 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -1880,7 +1880,7 @@ class KOBOTOUCH(KOBO): # Remove any entries for the Activity table - removes tile from new home page if self.has_activity_table(): - debug_print('KoboTouch:delete_via_sql: detete from Activity') + debug_print('KoboTouch:delete_via_sql: delete from Activity') cursor.execute('delete from Activity where Id =?', t) connection.commit() @@ -2391,7 +2391,8 @@ class KOBOTOUCH(KOBO): cursor = connection.cursor() cursor.execute(delete_query) cursor.execute(update_query) - cursor.execute(delete_activity_query) + if self.has_activity_table(): + cursor.execute(delete_activity_query) connection.commit() cursor.close()