mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #394
This commit is contained in:
parent
25b44ddfb7
commit
740798c515
@ -981,6 +981,8 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE;
|
||||
author = self.conn.execute('SELECT id from authors WHERE name=?', (a,)).fetchone()
|
||||
if author:
|
||||
aid = author[0]
|
||||
# Handle change of case
|
||||
self.conn.execute('UPDATE authors SET name=? WHERE id=?', (a, aid))
|
||||
else:
|
||||
aid = self.conn.execute('INSERT INTO authors(name) VALUES (?)', (a,)).lastrowid
|
||||
self.conn.execute('INSERT INTO books_authors_link(book, author) VALUES (?,?)', (id, aid))
|
||||
|
Loading…
x
Reference in New Issue
Block a user