diff --git a/cps/epub.py b/cps/epub.py index e78e5b88..a45fb926 100644 --- a/cps/epub.py +++ b/cps/epub.py @@ -71,8 +71,7 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension): 'dc': 'http://purl.org/dc/elements/1.1/' } - epub_zip = zipfile.ZipFile(tmp_file_path) - tree, cf_name = get_content_opf(epub_zip, ns) + tree, cf_name = get_content_opf(tmp_file_path, ns) cover_path = os.path.dirname(cf_name) @@ -115,6 +114,7 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension): epub_metadata = parse_epub_series(ns, tree, epub_metadata) + epub_zip = zipfile.ZipFile(tmp_file_path) cover_file = parse_epub_cover(ns, tree, epub_zip, cover_path, tmp_file_path) identifiers = [] diff --git a/cps/helper.py b/cps/helper.py index ad89e2bf..975a2523 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -1018,6 +1018,7 @@ def do_calibre_export(book_id, book_format, ): except OSError as ex: # ToDo real error handling log.error_or_exception(ex) + return None, None ################################## diff --git a/cps/tasks/convert.py b/cps/tasks/convert.py index 3b0ee2ea..8cb29197 100644 --- a/cps/tasks/convert.py +++ b/cps/tasks/convert.py @@ -208,7 +208,7 @@ class TaskConvert(CalibreTask): return def _convert_kepubify(self, file_path, format_old_ext, format_new_ext): - if config.config_embed_metadata: + if config.config_embed_metadata and config.config_binariesdir: tmp_dir, temp_file_name = helper.do_calibre_export(self.book_id, format_old_ext[1:]) filename = os.path.join(tmp_dir, temp_file_name + format_old_ext) temp_file_path = tmp_dir diff --git a/cps/tasks/metadata_backup.py b/cps/tasks/metadata_backup.py index 9ca6b830..2f402448 100644 --- a/cps/tasks/metadata_backup.py +++ b/cps/tasks/metadata_backup.py @@ -89,7 +89,7 @@ class TaskBackupMetadata(CalibreTask): def open_metadata(self, book, custom_columns): # package = self.create_new_metadata_backup(book, custom_columns) - package = create_new_metadata_backup(book, custom_columns, self.export_language) + package = create_new_metadata_backup(book, custom_columns, self.export_language, self.translated_title) if config.config_use_google_drive: if not gdriveutils.is_gdrive_ready(): raise Exception('Google Drive is configured but not ready') diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 879f65f4..cbc8dd34 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
Start Time: 2023-12-16 20:44:16
+Start Time: 2024-01-13 20:33:30
Stop Time: 2023-12-17 03:29:30
+Stop Time: 2024-01-14 03:06:58
Duration: 5h 43 min
+Duration: 5h 26 min
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 57, in test_backup_all + self.assertEqual(11, len(all_files)) +AssertionError: 11 != 0+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 181, in test_backup_change_book_author + self.assertEqual(["Frodo Beutlin","Norbert Halagal","Liu Yang","Hector Gonçalves"], metadata['author']) +AssertionError: Lists differ: ['Frodo Beutlin', 'Norbert Halagal', 'Liu Yang', 'Hector Gonçalves'] != [] + +First list contains 4 additional elements. +First extra element 0: +'Frodo Beutlin' + +- ['Frodo Beutlin', 'Norbert Halagal', 'Liu Yang', 'Hector Gonçalves'] ++ []+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 310, in test_backup_change_book_description + self.assertCountEqual(metadata['description'], "<p><strong>Test</strong></p>") +AssertionError: Element counts were not equal: +First has 0, Second has 4: '<' +First has 0, Second has 2: 'p' +First has 0, Second has 4: '>' +First has 0, Second has 3: 's' +First has 0, Second has 3: 't' +First has 0, Second has 2: 'r' +First has 0, Second has 2: 'o' +First has 0, Second has 2: 'n' +First has 0, Second has 2: 'g' +First has 0, Second has 1: 'T' +First has 0, Second has 1: 'e' +First has 0, Second has 2: '/'+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 264, in test_backup_change_book_language + self.assertEqual(metadata['language'], ["en"]) +AssertionError: Lists differ: [] != ['en'] + +Second list contains 1 additional elements. +First extra element 0: +'en' + +- [] ++ ['en']+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 155, in test_backup_change_book_publisher + self.assertEqual(metadata['publisher'], 'Lo,执|1u') +AssertionError: '' != 'Lo,执|1u' ++ Lo,执|1u+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 205, in test_backup_change_book_publishing_date + self.assertEqual(metadata['pub_date'].date(), date(101, 1, 1)) +AttributeError: 'str' object has no attribute 'date'+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 291, in test_backup_change_book_rating + self.assertCountEqual(metadata['rating']['content'], "6") +TypeError: string indices must be integers+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 125, in test_backup_change_book_series_index + self.assertEqual(metadata['series_index']['content'], "1.53") +TypeError: string indices must be integers+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 227, in test_backup_change_book_tags + self.assertEqual(metadata['tags'], ['Lo执|1u']) +AssertionError: Lists differ: [] != ['Lo执|1u'] + +Second list contains 1 additional elements. +First extra element 0: +'Lo执|1u' + +- [] ++ ['Lo执|1u']+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 165, in test_backup_change_book_title + self.assertEqual(metadata['title'], "Buuko") +AssertionError: '' != 'Buuko' ++ Buuko+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 506, in test_backup_change_custom_Comment + custom = json.loads(metadata['custom_8']['content']) +TypeError: string indices must be integers+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 567, in test_backup_change_custom_Enum + custom = json.loads(metadata['custom_6']['content']) +TypeError: string indices must be integers+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 324, in test_backup_change_custom_bool + custom = json.loads(metadata['custom_1']['content']) +TypeError: string indices must be integers+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 533, in test_backup_change_custom_categories + custom = json.loads(metadata['custom_9']['content']) +TypeError: string indices must be integers+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 478, in test_backup_change_custom_date + custom = json.loads(metadata['custom_2']['content']) +TypeError: string indices must be integers+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 358, in test_backup_change_custom_float + custom = json.loads(metadata['custom_5']['content']) +TypeError: string indices must be integers+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 391, in test_backup_change_custom_int + custom = json.loads(metadata['custom_4']['content']) +TypeError: string indices must be integers+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 424, in test_backup_change_custom_rating + custom = json.loads(metadata['custom_3']['content']) +TypeError: string indices must be integers+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 451, in test_backup_change_custom_text + custom = json.loads(metadata['custom_10']['content']) +TypeError: string indices must be integers+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata.py", line 604, in test_upload_book + self.assertEqual(metadata['title'], details['title']) +AssertionError: '' != 'book' ++ book+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_backup_metadata_gdrive.py", line 109, in test_backup_gdrive + self.assertTrue(fs.isfile(remote_meta.replace('\\', '/'))) +AssertionError: False is not true+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_cover_edit_books.py", line 81, in test_upload_jpg + self.assertFalse(self.check_element_on_page((By.ID, 'flash_danger'))) +AssertionError: <selenium.webdriver.remote.webelement.WebElement (session="758d3d76-66ea-472a-acf9-730236cb5ef6", element="0768a5fa-79ad-497d-8e26-e14146349e1d")> is not false+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_kepubify.py", line 135, in test_convert_only + self.assertEqual(ret[-1]['result'], 'Finished') +AssertionError: 'Failed' != 'Finished' +- Failed ++ Finished+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_kepubify_gdrive.py", line 191, in test_convert_only + self.assertEqual(ret[-1]['result'], 'Finished') +AssertionError: 'Failed' != 'Finished' +- Failed ++ Finished+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_edit_books.py", line 998, in test_upload_book_epub + self.assertEqual('book9', details['title']) +AssertionError: 'book9' != 'book' +- book9 +? - ++ book+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_edit_books_author.py", line 432, in test_rename_capital_on_upload + self.assertEqual('Useless', details['title']) +AssertionError: 'Useless' != 'title' +- Useless ++ title+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_edit_books_author_gdrive.py", line 553, in test_rename_capital_on_upload + self.assertEqual('Useless', details['title']) +AssertionError: 'Useless' != 'title' +- Useless ++ title+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_edit_books_metadata.py", line 90, in test_load_metadata + elif 'https://amazon.com/' == results[20]['source']: +IndexError: list index out of range+