Fix #2004167 [Bug in calibre.db.cache when run from source code](https://bugs.launchpad.net/calibre/+bug/2004167)

This commit is contained in:
Kovid Goyal 2023-01-30 20:39:37 +05:30
parent f0f4d95202
commit 878d93327e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2651,7 +2651,10 @@ class Cache:
fmts = field.table.book_col_map.get(book_id, ())
if not fmts:
continue
mi = self._get_metadata(book_id, get_cover=True, cover_as_data=True)
mi = self._get_metadata(book_id)
cdata = self.cover(book_id)
if cdata:
mi.cover_data = ('jpeg', cdata)
try:
path = self._field_for('path', book_id).replace('/', os.sep)
except: