mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
No device collections if shelves not maintained
Kobo driver: Display device collections even if the driver is configured to not manage shelves on the device. Fixes #1214233 [Collections are empty when not maintaining shelves on Kobo devices](https://bugs.launchpad.net/calibre/+bug/1214233) Skip getting the shelf collections if the Kobo driver is not configured to maintain them. This was wiping out the device collections.
This commit is contained in:
parent
c65f952f0f
commit
55e8c029e7
@ -44,7 +44,7 @@ class KOBO(USBMS):
|
||||
gui_name = 'Kobo Reader'
|
||||
description = _('Communicate with the Kobo Reader')
|
||||
author = 'Timothy Legge and David Forrester'
|
||||
version = (2, 1, 0)
|
||||
version = (2, 1, 1)
|
||||
|
||||
dbversion = 0
|
||||
fwversion = 0
|
||||
@ -2112,9 +2112,6 @@ class KOBOTOUCH(KOBO):
|
||||
create_bookshelves = False
|
||||
update_series_details = False
|
||||
|
||||
collections = booklists.get_collections(collections_attributes)
|
||||
# debug_print('KoboTouch:update_device_database_collections - Collections:', collections)
|
||||
|
||||
opts = self.settings()
|
||||
if opts.extra_customization:
|
||||
create_bookshelves = opts.extra_customization[self.OPT_CREATE_BOOKSHELVES] and self.supports_bookshelves()
|
||||
@ -2123,6 +2120,9 @@ class KOBOTOUCH(KOBO):
|
||||
delete_empty_shelves = False
|
||||
bookshelf_attribute = len(collections_attributes)
|
||||
|
||||
collections = booklists.get_collections(collections_attributes) if bookshelf_attribute else None
|
||||
# debug_print('KoboTouch:update_device_database_collections - Collections:', collections)
|
||||
|
||||
# Create a connection to the sqlite database
|
||||
# Needs to be outside books collection as in the case of removing
|
||||
# the last book from the collection the list of books is empty
|
||||
@ -2551,11 +2551,11 @@ class KOBOTOUCH(KOBO):
|
||||
if show_debug:
|
||||
debug_print(' Did not find a record - adding')
|
||||
cursor.execute(addquery, add_values)
|
||||
connection.commit()
|
||||
elif result[0] == 'true':
|
||||
if show_debug:
|
||||
debug_print(' Found a record - updating - result=', result)
|
||||
cursor.execute(updatequery, update_values)
|
||||
|
||||
connection.commit()
|
||||
|
||||
cursor.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user