diff --git a/src/calibre/db/adding.py b/src/calibre/db/adding.py index b78e6fdadb..6acd635196 100644 --- a/src/calibre/db/adding.py +++ b/src/calibre/db/adding.py @@ -256,18 +256,20 @@ def add_catalog(cache, path, title, dbapi=None): try: mi = get_metadata(stream, fmt) mi.authors = ['calibre'] - except: + except Exception: mi = Metadata(title, ['calibre']) mi.title, mi.authors = title, ['calibre'] mi.author_sort = 'calibre' # The MOBI/AZW3 format sets author sort to date - mi.tags = [_('Catalog')] mi.pubdate = mi.timestamp = utcnow() if fmt == 'mobi': mi.cover, mi.cover_data = None, (None, None) if db_id is None: + mi.tags = [_('Catalog')] db_id = cache._create_book_entry(mi, apply_import_tags=False) new_book_added = True else: + if not mi.tags or _('Catalog') not in mi.tags: + mi.tags.append(_('Catalog')) cache._set_metadata(db_id, mi) cache.add_format(db_id, fmt, stream, dbapi=dbapi) # Can't keep write lock since post-import hooks might run