mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 00:13:50 +02:00
...
This commit is contained in:
parent
cafc97cca7
commit
ca1dc3c0dd
1 changed files with 14 additions and 4 deletions
|
|
@ -13,9 +13,11 @@
|
|||
|
||||
import os, time, re
|
||||
import sqlite3 as sqlite
|
||||
from sqlite3 import DatabaseError
|
||||
from contextlib import closing
|
||||
from datetime import date
|
||||
|
||||
from calibre.devices.errors import DeviceError
|
||||
from calibre.devices.usbms.driver import USBMS, debug_print
|
||||
from calibre.devices.usbms.device import USBDevice
|
||||
from calibre.devices.usbms.books import CollectionsBookList
|
||||
|
|
@ -275,11 +277,19 @@ def update_device_books(self, connection, booklist, source_id, plugboard):
|
|||
refresh_covers = opts.extra_customization[self.OPT_REFRESH_COVERS]
|
||||
use_sony_authors = opts.extra_customization[self.OPT_USE_SONY_AUTHORS]
|
||||
|
||||
cursor = connection.cursor()
|
||||
try:
|
||||
cursor = connection.cursor()
|
||||
|
||||
# Get existing books
|
||||
query = 'SELECT file_path, _id FROM books'
|
||||
cursor.execute(query)
|
||||
# Get existing books
|
||||
query = 'SELECT file_path, _id FROM books'
|
||||
cursor.execute(query)
|
||||
except DatabaseError:
|
||||
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.')
|
||||
|
||||
db_books = {}
|
||||
for i, row in enumerate(cursor):
|
||||
|
|
|
|||
Loading…
Reference in a new issue