Ignore metadata_pre_restore.db when doing a library check

This commit is contained in:
Kovid Goyal 2022-01-27 14:46:16 +05:30
parent 80a4cb8a46
commit c92c2c78c3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -13,7 +13,8 @@ from calibre.ebooks import BOOK_EXTENSIONS
from polyglot.builtins import iteritems from polyglot.builtins import iteritems
EBOOK_EXTENSIONS = frozenset(BOOK_EXTENSIONS) EBOOK_EXTENSIONS = frozenset(BOOK_EXTENSIONS)
NORMALS = frozenset(['metadata.opf', 'cover.jpg']) NORMALS = frozenset({'metadata.opf', 'cover.jpg'})
IGNORE_AT_TOP_LEVEL = frozenset({'metadata.db', 'metadata_db_prefs_backup.json', 'metadata_pre_restore.db'})
''' '''
Checks fields: Checks fields:
@ -94,8 +95,7 @@ class CheckLibrary:
lib = self.src_library_path lib = self.src_library_path
for auth_dir in os.listdir(lib): for auth_dir in os.listdir(lib):
if self.ignore_name(auth_dir) or auth_dir in {'metadata.db', if self.ignore_name(auth_dir) or auth_dir in IGNORE_AT_TOP_LEVEL:
'metadata_db_prefs_backup.json'}:
continue continue
auth_path = os.path.join(lib, auth_dir) auth_path = os.path.join(lib, auth_dir)
# First check: author must be a directory # First check: author must be a directory