This commit is contained in:
Kovid Goyal 2008-04-11 20:02:42 +05:30
parent 5ff40b12bb
commit 57ff561aff

View File

@ -1118,7 +1118,10 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE;
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))
try:
self.conn.execute('INSERT INTO books_authors_link(book, author) VALUES (?,?)', (id, aid))
except sqlite.IntegrityError: # Sometimes books specify the same author twice in their metadata
pass
self.conn.commit()
def set_author_sort(self, id, sort):