diff --git a/cps/helper.py b/cps/helper.py
index 88c0550ba..1e9c03211 100644
--- a/cps/helper.py
+++ b/cps/helper.py
@@ -137,43 +137,8 @@ def send_registration_mail(e_mail, user_name, default_password, resend=False):
return
-def check_send_to_kindle_without_converter(entry):
+def check_send_to_kindle_with_converter(formats):
bookformats = list()
- # no converter - only for mobi and pdf formats
- for ele in iter(entry.data):
- if ele.uncompressed_size < config.mail_size:
- if 'MOBI' in ele.format:
- bookformats.append({'format': 'Mobi',
- 'convert': 0,
- 'text': _('Send %(format)s to Kindle', format='Mobi')})
- if 'PDF' in ele.format:
- bookformats.append({'format': 'Pdf',
- 'convert': 0,
- 'text': _('Send %(format)s to Kindle', format='Pdf')})
- if 'AZW' in ele.format:
- bookformats.append({'format': 'Azw',
- 'convert': 0,
- 'text': _('Send %(format)s to Kindle', format='Azw')})
- return bookformats
-
-def check_send_to_kindle_with_converter(entry):
- bookformats = list()
- formats = list()
- for ele in iter(entry.data):
- if ele.uncompressed_size < config.mail_size:
- formats.append(ele.format)
- if 'MOBI' in formats:
- bookformats.append({'format': 'Mobi',
- 'convert': 0,
- 'text': _('Send %(format)s to Kindle', format='Mobi')})
- if 'AZW' in formats:
- bookformats.append({'format': 'Azw',
- 'convert': 0,
- 'text': _('Send %(format)s to Kindle', format='Azw')})
- if 'PDF' in formats:
- bookformats.append({'format': 'Pdf',
- 'convert': 0,
- 'text': _('Send %(format)s to Kindle', format='Pdf')})
if 'EPUB' in formats and 'MOBI' not in formats:
bookformats.append({'format': 'Mobi',
'convert': 1,
@@ -193,12 +158,27 @@ def check_send_to_kindle(entry):
"""
returns all available book formats for sending to Kindle
"""
+ formats = list()
+ bookformats = list()
if len(entry.data):
- if not config.config_converterpath:
- book_formats = check_send_to_kindle_with_converter(entry)
- else:
- book_formats = check_send_to_kindle_with_converter(entry)
- return book_formats
+ for ele in iter(entry.data):
+ if ele.uncompressed_size < config.mail_size:
+ formats.append(ele.format)
+ if 'MOBI' in formats:
+ bookformats.append({'format': 'Mobi',
+ 'convert': 0,
+ 'text': _('Send %(format)s to Kindle', format='Mobi')})
+ if 'PDF' in formats:
+ bookformats.append({'format': 'Pdf',
+ 'convert': 0,
+ 'text': _('Send %(format)s to Kindle', format='Pdf')})
+ if 'AZW' in formats:
+ bookformats.append({'format': 'Azw',
+ 'convert': 0,
+ 'text': _('Send %(format)s to Kindle', format='Azw')})
+ if config.config_converterpath:
+ bookformats.extend(check_send_to_kindle_with_converter(formats))
+ return bookformats
else:
log.error(u'Cannot find book entry %d', entry.id)
return None
diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html
index 702a2668e..3bfa463d5 100644
--- a/test/Calibre-Web TestSummary_Linux.html
+++ b/test/Calibre-Web TestSummary_Linux.html
@@ -37,20 +37,20 @@
-
Start Time: 2021-02-08 20:40:55
+
Start Time: 2021-03-14 17:35:34
-
Stop Time: 2021-02-08 23:09:33
+
Stop Time: 2021-03-14 19:59:35
-
Duration: 2h 0 min
+
Duration: 1h 55 min
@@ -386,12 +386,12 @@
-
+
| TestEbookConvertCalibre |
11 |
- 11 |
- 0 |
- 0 |
+ 7 |
+ 2 |
+ 2 |
0 |
Detail
@@ -400,20 +400,62 @@
- |
+
|
TestEbookConvertCalibre - test_convert_deactivate
|
- PASS |
+
+
+
+
+
+
+
+ |
-
+
|
TestEbookConvertCalibre - test_convert_email
|
- PASS |
+
+
+
+
+
+
+
+ |
@@ -427,20 +469,64 @@
-
+
|
TestEbookConvertCalibre - test_convert_only
|
- PASS |
+
+
+
+
+
+
+
+ |
-
+
|
TestEbookConvertCalibre - test_convert_parameter
|
- PASS |
+
+
+
+
+
+
+
+ |
@@ -569,12 +655,12 @@
-
+
| TestEbookConvertKepubify |
3 |
- 3 |
- 0 |
0 |
+ 2 |
+ 1 |
0 |
Detail
@@ -583,40 +669,102 @@
- |
+
|
TestEbookConvertKepubify - test_convert_deactivate
|
- PASS |
+
+
+
+
+
+
+
+ |
-
+
|
TestEbookConvertKepubify - test_convert_only
|
- PASS |
+
+
+
+
+
+
+
+ |
-
+
|
TestEbookConvertKepubify - test_convert_wrong_excecutable
|
- PASS |
+
+
+
+
+
+
+
+ |
-
+
| TestEbookConvertGDriveKepubify |
3 |
- 3 |
- 0 |
0 |
+ 2 |
+ 1 |
0 |
Detail
@@ -625,29 +773,91 @@
- |
+
|
TestEbookConvertGDriveKepubify - test_convert_deactivate
|
- PASS |
+
+
+
+
+
+
+
+ |
-
+
|
TestEbookConvertGDriveKepubify - test_convert_only
|
- PASS |
+
+
+
+
+
+
+
+ |
-
+
|
TestEbookConvertGDriveKepubify - test_convert_wrong_excecutable
|
- PASS |
+
+
+
+
+
+
+
+ |
@@ -1595,12 +1805,12 @@
-
+
| TestKoboSync |
9 |
- 8 |
+ 9 |
+ 0 |
0 |
- 1 |
0 |
Detail
@@ -1609,31 +1819,11 @@
- |
+
|
TestKoboSync - test_book_download
|
-
-
-
-
-
-
-
- |
+ PASS |
@@ -2316,6 +2506,47 @@ IndexError: list index out of range
+
+ | TestEditBooks |
+ 1 |
+ 0 |
+ 0 |
+ 0 |
+ 1 |
+
+ Detail
+ |
+
+
+
+
+
+ |
+ TestEditBooks - test_upload_book_pdf
+ |
+
+
+
+
+
+
+
+ |
+
+
+
+
+
| TestReader |
5 |
@@ -2324,13 +2555,13 @@ IndexError: list index out of range
0 |
0 |
- Detail
+ Detail
|
-
+
|
TestReader - test_comic_reader
|
@@ -2339,7 +2570,7 @@ IndexError: list index out of range
-
+
|
TestReader - test_epub_reader
|
@@ -2348,7 +2579,7 @@ IndexError: list index out of range
-
+
|
TestReader - test_pdf_reader
|
@@ -2357,7 +2588,7 @@ IndexError: list index out of range
-
+
|
TestReader - test_sound_listener
|
@@ -2366,7 +2597,7 @@ IndexError: list index out of range
-
+
|
TestReader - test_txt_reader
|
@@ -2384,13 +2615,13 @@ IndexError: list index out of range
0 |
0 |
- Detail
+ Detail
|
-
+
|
TestRegister - test_forgot_password
|
@@ -2399,7 +2630,7 @@ IndexError: list index out of range
-
+
|
TestRegister - test_illegal_email
|
@@ -2408,7 +2639,7 @@ IndexError: list index out of range
-
+
|
TestRegister - test_limit_domain
|
@@ -2417,7 +2648,7 @@ IndexError: list index out of range
-
+
|
TestRegister - test_register_no_server
|
@@ -2426,7 +2657,7 @@ IndexError: list index out of range
-
+
|
TestRegister - test_registering_only_email
|
@@ -2435,7 +2666,7 @@ IndexError: list index out of range
-
+
|
TestRegister - test_registering_user
|
@@ -2444,7 +2675,7 @@ IndexError: list index out of range
-
+
|
TestRegister - test_registering_user_fail
|
@@ -2453,7 +2684,7 @@ IndexError: list index out of range
-
+
|
TestRegister - test_user_change_password
|
@@ -2471,13 +2702,13 @@ IndexError: list index out of range
0 |
1 |
- Detail
+ Detail
|
-
+
|
TestShelf - test_add_shelf_from_search
|
@@ -2486,7 +2717,7 @@ IndexError: list index out of range
-
+
|
TestShelf - test_arrange_shelf
|
@@ -2495,7 +2726,7 @@ IndexError: list index out of range
-
+
|
TestShelf - test_delete_book_of_shelf
|
@@ -2504,7 +2735,7 @@ IndexError: list index out of range
-
+
|
TestShelf - test_private_shelf
|
@@ -2513,7 +2744,7 @@ IndexError: list index out of range
-
+
|
TestShelf - test_public_private_shelf
|
@@ -2522,7 +2753,7 @@ IndexError: list index out of range
-
+
|
TestShelf - test_public_shelf
|
@@ -2531,7 +2762,7 @@ IndexError: list index out of range
-
+
|
TestShelf - test_rename_shelf
|
@@ -2540,7 +2771,7 @@ IndexError: list index out of range
-
+
|
TestShelf - test_shelf_action_non_shelf_edit_role
|
@@ -2549,7 +2780,7 @@ IndexError: list index out of range
-
+
|
TestShelf - test_shelf_anonymous
|
@@ -2558,19 +2789,19 @@ IndexError: list index out of range
-
+
|
TestShelf - test_shelf_database_change
|
-
+
-
|