diff --git a/cps/admin.py b/cps/admin.py index 8c65e8589..ff34e8b8a 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -1716,6 +1716,13 @@ def _db_configuration_update_helper(): db_change = True except Exception as ex: return _db_configuration_result('{}'.format(ex), gdrive_error) + config.config_calibre_split = to_save.get('config_calibre_split', 0) == "on" + if config.config_calibre_split: + split_dir = to_save.get("config_calibre_split_dir") + if not os.path.exists(split_dir): + return _db_configuration_result(_("Books path not valid"), gdrive_error) + else: + _config_string(to_save, "config_calibre_split_dir") if db_change or not db_valid or not config.db_configured \ or config.config_calibre_dir != to_save["config_calibre_dir"]: @@ -1741,8 +1748,6 @@ def _db_configuration_update_helper(): calibre_db.update_config(config) if not os.access(os.path.join(config.config_calibre_dir, "metadata.db"), os.W_OK): flash(_("DB is not Writeable"), category="warning") - _config_string(to_save, "config_calibre_split_dir") - config.config_calibre_split = to_save.get('config_calibre_split', 0) == "on" calibre_db.update_config(config) config.save() return _db_configuration_result(None, gdrive_error) diff --git a/cps/config_sql.py b/cps/config_sql.py index 6a840af58..c810431b1 100644 --- a/cps/config_sql.py +++ b/cps/config_sql.py @@ -182,26 +182,6 @@ class _Settings(_Base): class ConfigSQL(object): # pylint: disable=no-member def __init__(self): - '''self.config_calibre_uuid = None - self.config_calibre_split_dir = None - self.dirty = None - self.config_logfile = None - self.config_upload_formats = None - self.mail_gmail_token = None - self.mail_server_type = None - self.mail_server = None - self.config_log_level = None - self.config_allowed_column_value = None - self.config_denied_column_value = None - self.config_allowed_tags = None - self.config_denied_tags = None - self.config_default_show = None - self.config_default_role = None - self.config_keyfile = None - self.config_certfile = None - self.config_rarfile_location = None - self.config_kepubifypath = None - self.config_binariesdir = None''' self.__dict__["dirty"] = list() def init_config(self, session, secret_key, cli): diff --git a/cps/embed_helper.py b/cps/embed_helper.py index 54db47ef6..f222bcd05 100644 --- a/cps/embed_helper.py +++ b/cps/embed_helper.py @@ -35,9 +35,7 @@ def do_calibre_export(book_id, book_format): my_env = os.environ.copy() if config.config_calibre_split: my_env['CALIBRE_OVERRIDE_DATABASE_PATH'] = os.path.join(config.config_calibre_dir, "metadata.db") - library_path = config.config_calibre_split_dir - else: - library_path = config.config_calibre_dir + library_path = config.get_book_path() opf_command = [calibredb_binarypath, 'export', '--dont-write-opf', '--with-library', library_path, '--to-dir', tmp_dir, '--formats', book_format, "--template", "{}".format(temp_file_name), str(book_id)] diff --git a/cps/helper.py b/cps/helper.py index c2fc9c237..529ed561e 100644 --- a/cps/helper.py +++ b/cps/helper.py @@ -670,6 +670,7 @@ def check_username(username): def valid_email(emails): + valid_emails = [] for email in emails.split(','): email = strip_whitespaces(email) # if email is not deleted @@ -677,9 +678,10 @@ def valid_email(emails): # Regex according to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#validation if not re.search(r"^[\w.!#$%&'*+\\/=?^_`{|}~-]+@[\w](?:[\w-]{0,61}[\w])?(?:\.[\w](?:[\w-]{0,61}[\w])?)*$", email): - log.error("Invalid Email address format") + log.error("Invalid Email address format for {}".format(email)) raise Exception(_("Invalid Email address format")) - return email + valid_emails.append(email) + return ",".join(valid_emails) def valid_password(check_password): diff --git a/cps/templates/search_form.html b/cps/templates/search_form.html index bdd8d8fc9..cea1d4368 100644 --- a/cps/templates/search_form.html +++ b/cps/templates/search_form.html @@ -9,7 +9,7 @@
Start Time: 2024-08-20 20:27:17
+Start Time: 2024-08-21 19:35:06
Stop Time: 2024-08-21 03:36:02
+Stop Time: 2024-08-22 02:49:49
Duration: 6h 2 min
+Duration: 6h 7 min
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 len(results)>19 and 'https://amazon.com/' == results[20]['source']: -IndexError: list index out of range+ File "/home/ozzie/Development/calibre-web-test/test/test_edit_books_metadata.py", line 100, in test_load_metadata + self.assertEqual('https://amazon.com/', results[am]['source']) +AssertionError: 'https://amazon.com/' != 'https://comicvine.gamespot.com/' +- https://amazon.com/ ++ https://comicvine.gamespot.com/
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 936, in test_watch_metadata - self.assertTrue(button) -AssertionError: False is not true+ File "/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py", line 976, in test_watch_metadata + self.assertNotIn('series', book) +AssertionError: 'series' unexpectedly found in {'id': 5, 'reader': [], 'title': 'testbook', 'author': ['John Döe'], 'rating': 0, 'languages': ['English'], 'identifier': [], 'cover': '/cover/5/og?c=1724266889', 'tag': [], 'publisher': ['Randomhäus'], 'pubdate': 'Jan 19, 2017', 'comment': 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.Aenean commodo ligula eget dolor.Aenean massa.Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.Nulla consequat massa quis enim.Donec pede justo, fringilla vel, aliquet nec, vulputate', 'add_shelf': [], 'del_shelf': [], 'edit_enable': True, 'kindle': None, 'kindlebtn': None, 'download': ['EPUB\n (6.7 kB)'], 'read': False, 'archived': False, 'series_all': 'Book 1 of test', 'series_index': '1', 'series': 'test', 'cust_columns': []}
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_embed_metadata.py", line 271, in test_email_epub_embed_metadata - task_len, ret = self.wait_tasks(tasks, 1) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1636, in wait_tasks - self.assertEqual(expected, task_len) -AssertionError: 1 != 2-
Traceback (most recent call last):
- File "/home/ozzie/Development/calibre-web-test/test/test_register.py", line 37, in setUpClass
- cls.email_server.start()
- File "/home/ozzie/Development/calibre-web-test/test/aiosmtpd/controller.py", line 88, in start
- raise self._thread_exception
- File "/home/ozzie/Development/calibre-web-test/test/aiosmtpd/controller.py", line 65, in _run
- self.server = self.loop.run_until_complete(
- File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
- return future.result()
- File "/usr/lib/python3.10/asyncio/base_events.py", line 1519, in create_server
- raise OSError(err.errno, 'error while attempting '
-OSError: [Errno 98] error while attempting to bind on address ('127.0.0.1', 1025): address already in use
- Traceback (most recent call last):
+ File "/home/ozzie/Development/calibre-web-test/test/test_shelf.py", line 562, in test_adv_search_shelf
+ self.assertEqual(len(self.adv_search({u'include_shelf': u'Search', 'book_title': 'book'})), 2)
+ File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 2173, in adv_search
+ ele = self.driver.find_element(By.XPATH,
+ File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 830, in find_element
+ return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
+ File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
+ self.error_handler.check_response(response)
+ File "/home/ozzie/Development/calibre-web-test/venv/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
+ raise exception_class(message, screen, stacktrace)
+selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //input[@value = 'book' and starts-with(@id, 'book_title') ]/..
+Stacktrace:
+RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
+WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
+NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:511:5
+dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16
+ Traceback (most recent call last):
- File "/home/ozzie/Development/calibre-web-test/test/test_split_library.py", line 102, in test_email_ebook
- self.email_server.start()
- File "/home/ozzie/Development/calibre-web-test/test/aiosmtpd/controller.py", line 88, in start
- raise self._thread_exception
- File "/home/ozzie/Development/calibre-web-test/test/aiosmtpd/controller.py", line 65, in _run
- self.server = self.loop.run_until_complete(
- File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
- return future.result()
- File "/usr/lib/python3.10/asyncio/base_events.py", line 1519, in create_server
- raise OSError(err.errno, 'error while attempting '
-OSError: [Errno 98] error while attempting to bind on address ('127.0.0.1', 1025): address already in use
- Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py", line 327, in test_sideloaded_book - self.assertGreaterEqual(diff(BytesIO(list_cover), BytesIO(new_list_cover), delete_diff_file=True), 0.04) -AssertionError: 0.039521531544059706 not greater than or equal to 0.04-