From a3766452f358f5b979a93164799b44b8f47a6452 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 9 Jul 2011 17:34:24 -0600 Subject: [PATCH] ... --- src/calibre/devices/kobo/driver.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index 682eac99ce..d58049f801 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -319,8 +319,15 @@ class KOBO(USBMS): # Kobo does not delete the Book row (ie the row where the BookID is Null) # The next server sync should remove the row cursor.execute('delete from content where BookID = ?', t) - cursor.execute('update content set ReadStatus=0, FirstTimeReading = \'true\', ___PercentRead=0, ___ExpirationStatus=3 ' \ + try: + cursor.execute('update content set ReadStatus=0, FirstTimeReading = \'true\', ___PercentRead=0, ___ExpirationStatus=3 ' \ 'where BookID is Null and ContentID =?',t) + except Exception as e: + if 'no such column' not in str(e): + raise + cursor.execute('update content set ReadStatus=0, FirstTimeReading = \'true\', ___PercentRead=0 ' \ + 'where BookID is Null and ContentID =?',t) + connection.commit() @@ -609,9 +616,10 @@ class KOBO(USBMS): cursor = connection.cursor() try: cursor.execute (query) - except: + except Exception as e: debug_print(' Database Exception: Unable to reset Shortlist list') - raise + if 'no such column' not in str(e): + raise else: connection.commit() debug_print(' Commit: Reset FavouritesIndex list') @@ -625,7 +633,8 @@ class KOBO(USBMS): cursor.execute('update content set FavouritesIndex=1 where BookID is Null and ContentID = ?', t) except: debug_print(' Database Exception: Unable set book as Shortlist') - raise + if 'no such column' not in str(e): + raise else: connection.commit() debug_print(' Commit: Set FavouritesIndex')