Skip to content

Commit

Permalink
Adapt one more query to new boolean values
Browse files Browse the repository at this point in the history
  • Loading branch information
beedaddy committed Jul 25, 2024
1 parent ff93e10 commit afbd4cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/calibre/devices/kobo/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ def update_booklist(prefix, path, ContentID, ContentType, MimeType, ImageID,
# - FW2.0.0, DBVersion 53,55 accessibility == 1
# - FW2.1.2 beta, DBVersion == 56, accessibility == -1:
# So, the following should be OK
if isdownloaded == 'false':
if isdownloaded == 'false' or isdownloaded == False:
if self.dbversion < 56 and accessibility <= 1 or self.dbversion >= 56 and accessibility == -1:
playlist_map[lpath].append('Deleted')
allow_shelves = False
Expand Down Expand Up @@ -2267,7 +2267,10 @@ def upload_books(self, files, names, on_card=None, end_session=True,
try:
with closing(self.device_database_connection()) as connection:
cursor = connection.cursor()
cleanup_query = "DELETE FROM content WHERE ContentID = ? AND Accessibility = 1 AND IsDownloaded = 'false'"
if self.dbversion >= self.min_dbversion_real_bools and self.isTolinoDevice():
cleanup_query = "DELETE FROM content WHERE ContentID = ? AND Accessibility = 1 AND IsDownloaded = false"
else:
cleanup_query = "DELETE FROM content WHERE ContentID = ? AND Accessibility = 1 AND IsDownloaded = 'false'"

for fname, cycle in result:
show_debug = self.is_debugging_title(fname)
Expand Down

0 comments on commit afbd4cb

Please sign in to comment.