mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
calibredb:Don't error out when listing books that have missing formats
This commit is contained in:
parent
6ad621a920
commit
5c2ca385b5
@ -126,7 +126,8 @@ def do_list(db, fields, sort_by, ascending, search_text, line_width, separator,
|
|||||||
fields = ['id'] + fields
|
fields = ['id'] + fields
|
||||||
if output_format == 'text':
|
if output_format == 'text':
|
||||||
for f in data:
|
for f in data:
|
||||||
f['formats'] = u'[%s]'%u','.join(f['formats'])
|
fmts = [x for x in f['formats'] if x is not None]
|
||||||
|
f['formats'] = u'[%s]'%u','.join(fmts)
|
||||||
widths = list(map(lambda x : 0, fields))
|
widths = list(map(lambda x : 0, fields))
|
||||||
for record in data:
|
for record in data:
|
||||||
for f in record.keys():
|
for f in record.keys():
|
||||||
|
@ -1525,6 +1525,8 @@ class LibraryDatabase2(LibraryDatabase):
|
|||||||
if formats:
|
if formats:
|
||||||
for fmt in formats.split(','):
|
for fmt in formats.split(','):
|
||||||
path = self.format_abspath(x['id'], fmt, index_is_id=True)
|
path = self.format_abspath(x['id'], fmt, index_is_id=True)
|
||||||
|
if path is None:
|
||||||
|
continue
|
||||||
if prefix != self.library_path:
|
if prefix != self.library_path:
|
||||||
path = os.path.relpath(path, self.library_path)
|
path = os.path.relpath(path, self.library_path)
|
||||||
path = os.path.join(prefix, path)
|
path = os.path.join(prefix, path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user