From 56cfff0f9e2ae9de7e96fbd0a61d60924c7193a4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 12 Jul 2014 08:40:19 +0530 Subject: [PATCH] ... --- src/calibre/db/cache.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index 3539229b95..7660bfeea9 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -1328,7 +1328,10 @@ class Cache(object): path = path.replace('/', os.sep) title = self._field_for('title', book_id, default_value=_('Unknown')) - author = self._field_for('authors', book_id, default_value=(_('Unknown'),))[0] + try: + author = self._field_for('authors', book_id, default_value=(_('Unknown'),))[0] + except IndexError: + author = _('Unknown') stream = stream_or_path if hasattr(stream_or_path, 'read') else lopen(stream_or_path, 'rb') size, fname = self.backend.add_format(book_id, fmt, stream, title, author, path, name)