This commit is contained in:
Kovid Goyal 2011-07-09 17:34:24 -06:00
parent f411317850
commit a3766452f3

View File

@ -319,8 +319,15 @@ class KOBO(USBMS):
# Kobo does not delete the Book row (ie the row where the BookID is Null) # Kobo does not delete the Book row (ie the row where the BookID is Null)
# The next server sync should remove the row # The next server sync should remove the row
cursor.execute('delete from content where BookID = ?', t) 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) '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() connection.commit()
@ -609,9 +616,10 @@ class KOBO(USBMS):
cursor = connection.cursor() cursor = connection.cursor()
try: try:
cursor.execute (query) cursor.execute (query)
except: except Exception as e:
debug_print(' Database Exception: Unable to reset Shortlist list') debug_print(' Database Exception: Unable to reset Shortlist list')
raise if 'no such column' not in str(e):
raise
else: else:
connection.commit() connection.commit()
debug_print(' Commit: Reset FavouritesIndex list') 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) cursor.execute('update content set FavouritesIndex=1 where BookID is Null and ContentID = ?', t)
except: except:
debug_print(' Database Exception: Unable set book as Shortlist') debug_print(' Database Exception: Unable set book as Shortlist')
raise if 'no such column' not in str(e):
raise
else: else:
connection.commit() connection.commit()
debug_print(' Commit: Set FavouritesIndex') debug_print(' Commit: Set FavouritesIndex')