From fd730f66095410057ef6a983bf99f93aea37d0d5 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 17 Aug 2024 09:28:31 +0200 Subject: [PATCH] Bugfix generate thumbnails on gdrive --- cps/tasks/thumbnail.py | 4 +- test/Calibre-Web TestSummary_Linux.html | 1008 ++++++++++------------- 2 files changed, 417 insertions(+), 595 deletions(-) diff --git a/cps/tasks/thumbnail.py b/cps/tasks/thumbnail.py index cc847274..a7658c02 100644 --- a/cps/tasks/thumbnail.py +++ b/cps/tasks/thumbnail.py @@ -197,9 +197,11 @@ class TaskGenerateCoverThumbnails(CalibreTask): img.format = thumbnail.format img.save(filename=filename) else: - with open(filename, 'rb') as fd: + stream.seek(0) + with open(filename, 'wb') as fd: copyfileobj(stream, fd) + except Exception as ex: # Bubble exception to calling function self.log.debug('Error generating thumbnail file: ' + str(ex)) diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index ed5f5134..145bf9a7 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,14 +37,14 @@
-

Start Time: 2024-08-15 19:27:26

+

Start Time: 2024-08-16 21:16:11

-

Stop Time: 2024-08-16 02:42:05

+

Stop Time: 2024-08-17 04:31:06

@@ -938,8 +938,8 @@
Traceback (most recent call last):
   File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_gdrive.py", line 495, in test_thumbnail_cache
-    self.assertEqual(count_files(thumbnail_cache_path), 20)
-AssertionError: 25 != 20
+ self.assertEqual(count_files(thumbnail_cache_path), 30) +AssertionError: 25 != 30
@@ -950,84 +950,52 @@ AssertionError: 25 != 20 - - _FailedTest - 2 + + TestEbookConvertKepubify + 4 + 4 0 0 - 2 0 - Detail + Detail - + -
_FailedTest - test_ebook_convert_kepubify
- - -
- ERROR -
- - - +
TestEbookConvertKepubify - test_convert_deactivate
+ PASS - + -
_FailedTest - test_pip_install
+
TestEbookConvertKepubify - test_convert_only
- -
- ERROR -
- - - + PASS + + + + + + +
TestEbookConvertKepubify - test_convert_wrong_excecutable
+ PASS + + + + + + +
TestEbookConvertKepubify - test_kobo_kepub_formats
+ + PASS @@ -1075,13 +1043,13 @@ ModuleNotFoundError: No module named 'build_release' - + TestEditAdditionalBooks 20 - 18 - 0 + 16 0 2 + 2 Detail @@ -1116,20 +1084,76 @@ ModuleNotFoundError: No module named 'build_release' - +
TestEditAdditionalBooks - test_delete_role
- PASS + +
+ ERROR +
+ + + + - +
TestEditAdditionalBooks - test_details_popup
- PASS + +
+ ERROR +
+ + + + @@ -1748,11 +1772,11 @@ ModuleNotFoundError: No module named 'build_release' - + TestEditAuthorsGdrive 7 - 7 - 0 + 6 + 1 0 0 @@ -1816,11 +1840,38 @@ ModuleNotFoundError: No module named 'build_release' - +
TestEditAuthorsGdrive - test_rename_capital_on_upload
- PASS + +
+ FAIL +
+ + + + @@ -2898,11 +2949,11 @@ IndexError: list index out of range - + TestKoboSyncBig 6 - 5 - 1 + 6 + 0 0 0 @@ -2912,31 +2963,11 @@ IndexError: list index out of range - +
TestKoboSyncBig - test_download_cover
- -
- FAIL -
- - - - + PASS @@ -3976,6 +4007,55 @@ AssertionError: 4590 != 3060 + + _FailedTest + 1 + 0 + 0 + 1 + 0 + + Detail + + + + + + + +
_FailedTest - test_pip_install
+ + +
+ ERROR +
+ + + + + + + + + TestReader 8 @@ -3984,13 +4064,13 @@ AssertionError: 4590 != 3060 0 1 - Detail + Detail - +
TestReader - test_cb7_reader
@@ -3999,7 +4079,7 @@ AssertionError: 4590 != 3060 - +
TestReader - test_comic_MACOS_files
@@ -4008,7 +4088,7 @@ AssertionError: 4590 != 3060 - +
TestReader - test_comic_reader
@@ -4017,7 +4097,7 @@ AssertionError: 4590 != 3060 - +
TestReader - test_epub_reader
@@ -4026,7 +4106,7 @@ AssertionError: 4590 != 3060 - +
TestReader - test_pdf_reader
@@ -4035,7 +4115,7 @@ AssertionError: 4590 != 3060 - +
TestReader - test_single_file_comic
@@ -4044,7 +4124,7 @@ AssertionError: 4590 != 3060 - +
TestReader - test_sound_listener
@@ -4053,7 +4133,7 @@ AssertionError: 4590 != 3060 - +
TestReader - test_txt_reader
@@ -4071,13 +4151,13 @@ AssertionError: 4590 != 3060 0 0 - Detail + Detail - +
TestReadOnlyDatabase - test_readonly_path
@@ -4095,13 +4175,13 @@ AssertionError: 4590 != 3060 0 0 - Detail + Detail - +
TestRegister - test_forgot_password
@@ -4110,7 +4190,7 @@ AssertionError: 4590 != 3060 - +
TestRegister - test_illegal_email
@@ -4119,7 +4199,7 @@ AssertionError: 4590 != 3060 - +
TestRegister - test_limit_domain
@@ -4128,7 +4208,7 @@ AssertionError: 4590 != 3060 - +
TestRegister - test_register_no_server
@@ -4137,7 +4217,7 @@ AssertionError: 4590 != 3060 - +
TestRegister - test_registering_only_email
@@ -4146,7 +4226,7 @@ AssertionError: 4590 != 3060 - +
TestRegister - test_registering_user
@@ -4155,7 +4235,7 @@ AssertionError: 4590 != 3060 - +
TestRegister - test_registering_user_fail
@@ -4164,7 +4244,7 @@ AssertionError: 4590 != 3060 - +
TestRegister - test_user_change_password
@@ -4182,13 +4262,13 @@ AssertionError: 4590 != 3060 0 0 - Detail + Detail - +
TestReverseProxy - test_logout
@@ -4197,7 +4277,7 @@ AssertionError: 4590 != 3060 - +
TestReverseProxy - test_move_page
@@ -4206,7 +4286,7 @@ AssertionError: 4590 != 3060 - +
TestReverseProxy - test_next
@@ -4215,7 +4295,7 @@ AssertionError: 4590 != 3060 - +
TestReverseProxy - test_reverse_about
@@ -4233,13 +4313,13 @@ AssertionError: 4590 != 3060 0 1 - Detail + Detail - +
TestShelf - test_access_shelf
@@ -4248,7 +4328,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_add_shelf_from_search
@@ -4257,7 +4337,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_adv_search_shelf
@@ -4266,7 +4346,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_arrange_shelf
@@ -4275,7 +4355,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_create_public_shelf
@@ -4284,7 +4364,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_create_public_shelf_no_permission
@@ -4293,7 +4373,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_delete_book_of_shelf
@@ -4302,7 +4382,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_private_shelf
@@ -4311,7 +4391,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_public_private_shelf
@@ -4320,7 +4400,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_public_shelf
@@ -4329,7 +4409,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_rename_shelf
@@ -4338,7 +4418,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_shelf_action_non_shelf_edit_role
@@ -4347,7 +4427,7 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_shelf_anonymous
@@ -4356,19 +4436,19 @@ AssertionError: 4590 != 3060 - +
TestShelf - test_shelf_database_change
- SKIP + SKIP
-