From 6320ea10a08332472e38fa873ad98499932bca47 Mon Sep 17 00:00:00 2001 From: David Forrester Date: Thu, 11 Dec 2014 22:19:36 +1100 Subject: [PATCH] Delete bookmarks from the database when deleting a book Not sure how I missed this, but the bookmarks where being left in the database when the books were deleted. This brings it in line with what happens when using the device to delete a book. Fixes #1401502 [Delete bookmarks from the database when deleting a book](https://bugs.launchpad.net/calibre/+bug/1401502) --- src/calibre/devices/kobo/driver.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index da4caf1b5a..d4904577ad 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -2020,6 +2020,11 @@ class KOBOTOUCH(KOBO): cursor = connection.cursor() debug_print('KoboTouch:delete_via_sql: have cursor') t = (ContentID,) + + # Delete the Bookmarks + debug_print('KoboTouch:delete_via_sql: Delete from Bookmark') + cursor.execute('DELETE FROM Bookmark WHERE VolumeID = ?', t) + # Delete from the Bookshelf debug_print('KoboTouch:delete_via_sql: Delete from the Bookshelf') cursor.execute('delete from ShelfContent where ContentID = ?', t)