mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sony T1: Tweaks/Bugfixes based on feedback/discovery
This commit is contained in:
parent
523a11c0c2
commit
236778f22f
@ -265,7 +265,7 @@ class PRST1(USBMS):
|
|||||||
values (?,?,?,?,?,?,?,?,?,0,0)
|
values (?,?,?,?,?,?,?,?,?,0,0)
|
||||||
'''
|
'''
|
||||||
t = (title, author, source_id, int(time.time() * 1000),
|
t = (title, author, source_id, int(time.time() * 1000),
|
||||||
calendar.timegm(book.datetime), lpath,
|
int(calendar.timegm(book.datetime) * 1000), lpath,
|
||||||
os.path.basename(book.lpath), book.size, book.mime)
|
os.path.basename(book.lpath), book.size, book.mime)
|
||||||
cursor.execute(query, t)
|
cursor.execute(query, t)
|
||||||
book.bookId = cursor.lastrowid
|
book.bookId = cursor.lastrowid
|
||||||
@ -278,7 +278,7 @@ class PRST1(USBMS):
|
|||||||
SET title = ?, author = ?, modified_date = ?, file_size = ?
|
SET title = ?, author = ?, modified_date = ?, file_size = ?
|
||||||
WHERE file_path = ?
|
WHERE file_path = ?
|
||||||
'''
|
'''
|
||||||
t = (title, author, calendar.timegm(book.datetime), book.size,
|
t = (title, author, int(calendar.timegm(book.datetime) * 1000), book.size,
|
||||||
lpath)
|
lpath)
|
||||||
cursor.execute(query, t)
|
cursor.execute(query, t)
|
||||||
book.bookId = db_books[lpath]
|
book.bookId = db_books[lpath]
|
||||||
@ -337,9 +337,9 @@ class PRST1(USBMS):
|
|||||||
db_books[row[0]] = row[1]
|
db_books[row[0]] = row[1]
|
||||||
|
|
||||||
for idx, book in enumerate(books):
|
for idx, book in enumerate(books):
|
||||||
|
if collection not in book.device_collections:
|
||||||
|
book.device_collections.append(collection)
|
||||||
if db_books.get(book.lpath, None) is None:
|
if db_books.get(book.lpath, None) is None:
|
||||||
if collection not in book.device_collections:
|
|
||||||
book.device_collections.append(collection)
|
|
||||||
query = '''
|
query = '''
|
||||||
INSERT INTO collections (collection_id, content_id,
|
INSERT INTO collections (collection_id, content_id,
|
||||||
added_order) values (?,?,?)
|
added_order) values (?,?,?)
|
||||||
@ -424,4 +424,5 @@ class PRST1(USBMS):
|
|||||||
t = (thumbnail_path, book.bookId,)
|
t = (thumbnail_path, book.bookId,)
|
||||||
cursor.execute(query, t)
|
cursor.execute(query, t)
|
||||||
|
|
||||||
|
connection.commit()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user