From 00f0e37bffe5f3795b3ddb79b5ace2bb18fed88e Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sat, 29 Jan 2011 09:26:51 +0000 Subject: [PATCH 1/2] Fix exception in restore_database caused by comma in a chained message --- src/calibre/gui2/dialogs/restore_library.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/dialogs/restore_library.py b/src/calibre/gui2/dialogs/restore_library.py index dd1befc11b..b5af0fcadd 100644 --- a/src/calibre/gui2/dialogs/restore_library.py +++ b/src/calibre/gui2/dialogs/restore_library.py @@ -104,7 +104,7 @@ def restore_database(db, parent=None): else: if r.errors_occurred: warning_dialog(parent, _('Success'), - _('Restoring the database succeeded with some warnings', + _('Restoring the database succeeded with some warnings' ' click Show details to see the details.'), det_msg=r.report, show=True) else: From 2dafa291845e380c7a1b00bb098b82d944b90961 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sat, 29 Jan 2011 12:30:12 +0000 Subject: [PATCH 2/2] 1) restore: provide OPF with the path to the folder containing the OPF file. Make the cover path be correct. 2) check_library.py: change the wording of the cover messages. --- src/calibre/library/check_library.py | 4 ++-- src/calibre/library/restore.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/library/check_library.py b/src/calibre/library/check_library.py index b49330db3e..19ecb97308 100644 --- a/src/calibre/library/check_library.py +++ b/src/calibre/library/check_library.py @@ -30,8 +30,8 @@ CHECKS = [('invalid_titles', _('Invalid titles'), True, False), ('missing_formats', _('Missing book formats'), False, False), ('extra_formats', _('Extra book formats'), True, False), ('extra_files', _('Unknown files in books'), True, False), - ('missing_covers', _('Missing covers in books'), False, True), - ('extra_covers', _('Extra covers in books'), True, True), + ('missing_covers', _('Missing covers files'), False, True), + ('extra_covers', _('Cover files not in database'), True, True), ('failed_folders', _('Folders raising exception'), False, False) ] diff --git a/src/calibre/library/restore.py b/src/calibre/library/restore.py index bc2c740279..76f3c0333d 100644 --- a/src/calibre/library/restore.py +++ b/src/calibre/library/restore.py @@ -141,7 +141,7 @@ class Restore(Thread): sizes = [os.path.getsize(os.path.join(dirpath, x)) for x in formats] names = [os.path.splitext(x)[0] for x in formats] opf = os.path.join(dirpath, 'metadata.opf') - mi = OPF(opf).to_book_metadata() + mi = OPF(opf, basedir=dirpath).to_book_metadata() timestamp = os.path.getmtime(opf) path = os.path.relpath(dirpath, self.src_library_path).replace(os.sep, '/')