From bb87507909ebfc2adcd2442e99fe771248aa5311 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 1 Oct 2010 11:27:14 -0600 Subject: [PATCH 1/2] ... --- src/calibre/library/check_library.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/calibre/library/check_library.py b/src/calibre/library/check_library.py index d0c8c640d2..641ee49312 100644 --- a/src/calibre/library/check_library.py +++ b/src/calibre/library/check_library.py @@ -12,7 +12,6 @@ from calibre.constants import filesystem_encoding from calibre.ebooks import BOOK_EXTENSIONS EBOOK_EXTENSIONS = frozenset(BOOK_EXTENSIONS) - NORMALS = frozenset(['metadata.opf', 'cover.jpg']) CHECKS = [('invalid_titles', _('Invalid titles')), @@ -42,7 +41,7 @@ class CheckLibrary(object): self.all_lc_dbpaths = frozenset([f.lower() for f in self.all_dbpaths]) self.db_id_regexp = re.compile(r'^.* \((\d+)\)$') - self.bad_ext_pat = re.compile(r'[^a-z]+') + self.bad_ext_pat = re.compile(r'[^a-z0-9]+') self.dirs = [] self.book_dirs = [] From e6142a543e0eb7f078115f48e2a3b950906adab4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 1 Oct 2010 11:28:58 -0600 Subject: [PATCH 2/2] Better is_ebook_file --- src/calibre/library/check_library.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/library/check_library.py b/src/calibre/library/check_library.py index 641ee49312..b0bcb98123 100644 --- a/src/calibre/library/check_library.py +++ b/src/calibre/library/check_library.py @@ -130,8 +130,9 @@ class CheckLibrary(object): if not ext: return False ext = ext[1:].lower() - if ext not in EBOOK_EXTENSIONS or \ - self.bad_ext_pat.search(ext) is not None: + if ext in EBOOK_EXTENSIONS: + return True + if self.bad_ext_pat.search(ext) is not None: return False return True