mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
BiBTex Catalog: Fix library_name field causing an error. Fixes #1158127 (Generate Catalog as BibTeX «KeyError: u'library_name'» error)
This commit is contained in:
parent
48e8461ce8
commit
1d46d096f8
@ -3626,6 +3626,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
if data['datatype'] == 'series':
|
if data['datatype'] == 'series':
|
||||||
FIELDS.add('%d_index'%x)
|
FIELDS.add('%d_index'%x)
|
||||||
data = []
|
data = []
|
||||||
|
library_name = os.path.basename(self.library_path)
|
||||||
for record in self.data:
|
for record in self.data:
|
||||||
if record is None: continue
|
if record is None: continue
|
||||||
db_id = record[self.FIELD_MAP['id']]
|
db_id = record[self.FIELD_MAP['id']]
|
||||||
@ -3649,6 +3650,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
x['cover'] = os.path.join(path, 'cover.jpg')
|
x['cover'] = os.path.join(path, 'cover.jpg')
|
||||||
if not record[self.FIELD_MAP['cover']]:
|
if not record[self.FIELD_MAP['cover']]:
|
||||||
x['cover'] = None
|
x['cover'] = None
|
||||||
|
x['library_name'] = library_name
|
||||||
formats = self.formats(record[self.FIELD_MAP['id']], index_is_id=True)
|
formats = self.formats(record[self.FIELD_MAP['id']], index_is_id=True)
|
||||||
if formats:
|
if formats:
|
||||||
for fmt in formats.split(','):
|
for fmt in formats.split(','):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user