mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-26 04:36:26 +01:00
...
This commit is contained in:
parent
be13ec4c1f
commit
a02d91fbf6
1 changed files with 8 additions and 6 deletions
|
|
@ -266,12 +266,14 @@ def update_device_database(self, booklist, collections_attributes, oncard):
|
|||
collections = booklist.get_collections(collections_attributes)
|
||||
|
||||
with closing(sqlite.connect(dbpath)) as connection:
|
||||
self.update_device_books(connection, booklist, source_id, plugboard)
|
||||
self.update_device_books(connection, booklist, source_id,
|
||||
plugboard, dbpath)
|
||||
self.update_device_collections(connection, booklist, collections, source_id)
|
||||
|
||||
debug_print('PRST1: finished update_device_database')
|
||||
|
||||
def update_device_books(self, connection, booklist, source_id, plugboard):
|
||||
def update_device_books(self, connection, booklist, source_id, plugboard,
|
||||
dbpath):
|
||||
opts = self.settings()
|
||||
upload_covers = opts.extra_customization[self.OPT_UPLOAD_COVERS]
|
||||
refresh_covers = opts.extra_customization[self.OPT_REFRESH_COVERS]
|
||||
|
|
@ -284,12 +286,12 @@ def update_device_books(self, connection, booklist, source_id, plugboard):
|
|||
query = 'SELECT file_path, _id FROM books'
|
||||
cursor.execute(query)
|
||||
except DatabaseError:
|
||||
raise DeviceError('The SONY database is corrupted. '
|
||||
' Delete the file books.db on your reader and then disconnect '
|
||||
raise DeviceError(('The SONY database is corrupted. '
|
||||
' Delete the file %s on your reader and then disconnect '
|
||||
' reconnect it. If you are using an SD card, you '
|
||||
' should delete the file on the card as well. Note that '
|
||||
' deleting this file may cause your reader to forget '
|
||||
' any notes/highlights, etc.')
|
||||
' deleting this file will cause your reader to forget '
|
||||
' any notes/highlights, etc.')%dbpath)
|
||||
|
||||
db_books = {}
|
||||
for i, row in enumerate(cursor):
|
||||
|
|
|
|||
Loading…
Reference in a new issue