mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Handle broken dbs with no author for book records
This commit is contained in:
parent
83d0b29938
commit
6a64723156
@ -976,7 +976,10 @@ class Cache(object):
|
||||
def update_path(self, book_ids, mark_as_dirtied=True):
|
||||
for book_id in book_ids:
|
||||
title = self._field_for('title', book_id, default_value=_('Unknown'))
|
||||
try:
|
||||
author = self._field_for('authors', book_id, default_value=(_('Unknown'),))[0]
|
||||
except IndexError:
|
||||
author = _('Unknown')
|
||||
self.backend.update_path(book_id, title, author, self.fields['path'], self.fields['formats'])
|
||||
if mark_as_dirtied:
|
||||
self._mark_as_dirty(book_ids)
|
||||
|
Loading…
x
Reference in New Issue
Block a user