mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix save to disk when author_sort is blank
This commit is contained in:
parent
b56166abb8
commit
817461bdfe
@ -1001,12 +1001,14 @@ class LibraryDatabase(object):
|
|||||||
id = self.id(index)
|
id = self.id(index)
|
||||||
au = self.conn.execute('SELECT author_sort FROM books WHERE id=?',
|
au = self.conn.execute('SELECT author_sort FROM books WHERE id=?',
|
||||||
(id,)).fetchone()[0]
|
(id,)).fetchone()[0]
|
||||||
|
if not au:
|
||||||
|
au = 'Unknown'
|
||||||
if not by_author.has_key(au):
|
if not by_author.has_key(au):
|
||||||
by_author[au] = []
|
by_author[au] = []
|
||||||
by_author[au].append(index)
|
by_author[au].append(index)
|
||||||
for au in by_author.keys():
|
for au in by_author.keys():
|
||||||
if au is None:
|
if not au:
|
||||||
au = ''
|
au = 'Unknown'
|
||||||
apath = os.path.join(dir, au)
|
apath = os.path.join(dir, au)
|
||||||
if not os.path.exists(apath):
|
if not os.path.exists(apath):
|
||||||
os.mkdir(apath)
|
os.mkdir(apath)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user