diff --git a/cps/db.py b/cps/db.py index fbb458e6..aaedcd06 100644 --- a/cps/db.py +++ b/cps/db.py @@ -53,7 +53,7 @@ from weakref import WeakSet log = logger.create() -cc_exceptions = ['composite'] +cc_exceptions = ['composite', 'series'] cc_classes = {} Base = declarative_base() @@ -472,7 +472,6 @@ class CalibreDB: # This is a WeakSet so that references here don't keep other CalibreDB # instances alive once they reach the end of their respective scopes instances = WeakSet() - series = False def __init__(self, expire_on_commit=True, init=False): """ Initialize a new CalibreDB session @@ -500,7 +499,6 @@ class CalibreDB: for row in cc: if row.datatype not in cc_exceptions: if row.datatype == 'series': - cls.series = True dicttable = {'__tablename__': 'books_custom_column_' + str(row.id) + '_link', 'id': Column(Integer, primary_key=True), 'book': Column(Integer, ForeignKey('books.id'), @@ -1029,14 +1027,10 @@ class CalibreDB: Base.metadata.remove(table) def reconnect_db(self, config, app_db_path): - if self.series: - from . import isoLanguages, web_server - web_server.stop(True) - else: - self.dispose() - self.engine.dispose() - self.setup_db(config.config_calibre_dir, app_db_path) - self.update_config(config) + self.dispose() + self.engine.dispose() + self.setup_db(config.config_calibre_dir, app_db_path) + self.update_config(config) def lcase(s): diff --git a/cps/epub.py b/cps/epub.py index d358d038..00ce907b 100644 --- a/cps/epub.py +++ b/cps/epub.py @@ -102,11 +102,11 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension): identifiers = [] for node in p.xpath('dc:identifier', namespaces=ns): - identifier_name=node.attrib.values()[-1]; - identifier_value=node.text; - if identifier_name in ('uuid','calibre'): - continue; - identifiers.append( [identifier_name, identifier_value] ) + identifier_name = node.attrib.values()[-1] + identifier_value = node.text + if identifier_name in ('uuid', 'calibre') or identifier_value is None: + continue + identifiers.append([identifier_name, identifier_value]) if not epub_metadata['title']: title = original_file_name diff --git a/cps/schedule.py b/cps/schedule.py index 44bb2c27..5f3326ef 100644 --- a/cps/schedule.py +++ b/cps/schedule.py @@ -33,7 +33,7 @@ def get_scheduled_tasks(reconnect=True): tasks.append([lambda: TaskReconnectDatabase(), 'reconnect', False]) # ToDo make configurable. Generate metadata.opf file for each changed book - if True: + if False: tasks.append([lambda: TaskBackupMetadata("en"), 'backup metadata', False]) # Generate all missing book cover thumbnails diff --git a/cps/ub.py b/cps/ub.py index 96e674d4..5dd7d646 100644 --- a/cps/ub.py +++ b/cps/ub.py @@ -796,6 +796,7 @@ def create_anonymous_user(_session): def create_admin_user(_session): user = User() user.name = "admin" + user.email = "admin@example.org" user.role = constants.ADMIN_USER_ROLES user.sidebar_view = constants.ADMIN_USER_SIDEBAR diff --git a/setup.cfg b/setup.cfg index de4e4714..1c531d48 100644 --- a/setup.cfg +++ b/setup.cfg @@ -47,7 +47,7 @@ install_requires = backports_abc>=0.4 Flask>=1.0.2,<2.1.0 iso-639>=0.4.5,<0.5.0 - PyPDF3>=1.0.0,<1.0.7 + PyPDF2>=1.20,<2.11.0 pytz>=2016.10 requests>=2.11.1,<2.28.0 SQLAlchemy>=1.3.0,<1.5.0 @@ -97,5 +97,5 @@ comics = natsort>=2.2.0,<8.2.0 comicapi>=2.2.0,<2.3.0 kobo = - jsonschema>=3.2.0,<4.8.0 + jsonschema>=3.2.0,<4.9.0 diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index 701e1431..3d9b593b 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
Start Time: 2022-07-29 22:16:18
+Start Time: 2022-09-24 21:26:53
Stop Time: 2022-07-30 04:12:54
+Stop Time: 2022-09-25 03:49:07
Duration: 5h 1 min
+Duration: 5h 27 min
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert.py", line 260, in test_convert_failed_and_email - self.assertEqual(1, task_len) -AssertionError: 1 != 0-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_ebook_convert.py", line 622, in test_convert_options - self.assertEqual(from_book, set(['-- select an option --', "TXT"])) -AssertionError: Items in the first set but not the second: -'AZW3'-
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_goodreads.py", line 108, in test_author_page + self.assertFalse(self.check_element_on_page((By.CLASS_NAME, "author-photo"))) +AssertionError: <selenium.webdriver.remote.webelement.WebElement (session="2520e615-2568-4cc5-b588-44e563fa14a2", element="138199ad-2df2-4990-8382-172c41178915")> is not false+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py", line 193, in test_cache_of_deleted_book + self.assertEqual(len(res), 1) +AssertionError: 2 != 1+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py", line 80, in test_cover_cache_on_database_change + self.assertLessEqual(len(res), 1, res) +AssertionError: 2 not less than or equal to 1 : [{'user': 'System', 'task': 'Metadata backup: Backing up Metadata', 'result': 'Failed', 'progress': '100 %', 'duration': ' 0s', 'start': '9/25/22, 2:16 AM'}, {'user': 'System', 'task': 'Cover Thumbnails: Generated 222 cover thumbnails', 'result': 'Finished', 'progress': '100 %', 'duration': ' 5s', 'start': '9/25/22, 2:16 AM'}]+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py", line 123, in test_cover_change_on_upload_new_cover + self.assertLessEqual(len(res), 1) +AssertionError: 2 not less than or equal to 1+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py", line 230, in test_cover_on_upload_book + self.assertLessEqual(len(res), 1) +AssertionError: 2 not less than or equal to 1+
ImportError: Failed to import test module: test_updater +Traceback (most recent call last): + File "/usr/lib/python3.10/unittest/loader.py", line 436, in _find_test_path + module = self._get_module_from_name(name) + File "/usr/lib/python3.10/unittest/loader.py", line 377, in _get_module_from_name + __import__(name) + File "/home/ozzie/Development/calibre-web-test/test/test_updater.py", line 20 + p = None +IndentationError: unexpected indent+
Traceback (most recent call last): + File "/home/ozzie/Development/calibre-web-test/test/test_user_list.py", line 556, in test_user_list_sort + self.assertEqual("+", ul['table'][0]['E-mail Address']['text']) +AssertionError: '+' != '1al@b.com' +- + ++ 1al@b.com+