mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Correct implementation of case in _set_authors
This commit is contained in:
parent
9036dd83d7
commit
fa0d8db045
@ -1642,8 +1642,11 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
a = a.strip().replace(',', '|')
|
a = a.strip().replace(',', '|')
|
||||||
if not isinstance(a, unicode):
|
if not isinstance(a, unicode):
|
||||||
a = a.decode(preferred_encoding, 'replace')
|
a = a.decode(preferred_encoding, 'replace')
|
||||||
author_id, name = \
|
aus = self.conn.get('SELECT id, name from authors WHERE name=?', (a,))
|
||||||
self.conn.get('SELECT id, name from authors WHERE name=?', (a,))[0]
|
if aus:
|
||||||
|
author_id, name = aus[0]
|
||||||
|
else:
|
||||||
|
author_id, name = (None, None)
|
||||||
if author_id:
|
if author_id:
|
||||||
aid = author_id
|
aid = author_id
|
||||||
# Handle change of case
|
# Handle change of case
|
||||||
|
Loading…
x
Reference in New Issue
Block a user