mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Do not error out when getting metadata for authors if the author name has either ::: or :#: in it. Fixes #912713 (":::" in authors -> exception)
This commit is contained in:
parent
282f185e91
commit
61340f3e86
@ -911,11 +911,18 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
||||
aum = []
|
||||
aus = {}
|
||||
aul = {}
|
||||
for (author, author_sort, link) in aut_list:
|
||||
aut = author.replace('|', ',')
|
||||
aum.append(aut)
|
||||
aus[aut] = author_sort.replace('|', ',')
|
||||
aul[aut] = link
|
||||
try:
|
||||
for (author, author_sort, link) in aut_list:
|
||||
aut = author.replace('|', ',')
|
||||
aum.append(aut)
|
||||
aus[aut] = author_sort.replace('|', ',')
|
||||
aul[aut] = link
|
||||
except ValueError:
|
||||
# Author has either ::: or :#: in it
|
||||
for x in row[fm['authors']].split(','):
|
||||
aum.append(x.replace('|', ','))
|
||||
aul[aum[-1]] = ''
|
||||
aus[aum[-1]] = aum[-1]
|
||||
mi.title = row[fm['title']]
|
||||
mi.authors = aum
|
||||
mi.author_sort = row[fm['author_sort']]
|
||||
|
Loading…
x
Reference in New Issue
Block a user