diff --git a/cps/kobo.py b/cps/kobo.py index 3686c174..501cbb47 100644 --- a/cps/kobo.py +++ b/cps/kobo.py @@ -423,7 +423,7 @@ def get_series(book): def get_seriesindex(book): - return book.series_index or 1 + return book.series_index if isinstance(book.series_index, float) else 1 def get_language(book): @@ -486,14 +486,16 @@ def get_metadata(book): if get_series(book): name = get_series(book) - metadata["Series"] = { - "Name": get_series(book), - "Number": get_seriesindex(book), # ToDo Check int() ? - "NumberFloat": float(get_seriesindex(book)), - # Get a deterministic id based on the series name. - "Id": str(uuid.uuid3(uuid.NAMESPACE_DNS, name)), - } - + try: + metadata["Series"] = { + "Name": get_series(book), + "Number": get_seriesindex(book), # ToDo Check int() ? + "NumberFloat": float(get_seriesindex(book)), + # Get a deterministic id based on the series name. + "Id": str(uuid.uuid3(uuid.NAMESPACE_DNS, name)), + } + except Exception as e: + print(e) return metadata diff --git a/test/Calibre-Web TestSummary_Linux.html b/test/Calibre-Web TestSummary_Linux.html index dcba2316..f49d0366 100644 --- a/test/Calibre-Web TestSummary_Linux.html +++ b/test/Calibre-Web TestSummary_Linux.html @@ -37,20 +37,20 @@
Start Time: 2024-10-27 21:36:02
+Start Time: 2024-10-31 19:45:00
Stop Time: 2024-10-28 04:51:42
+Stop Time: 2024-11-01 03:02:38
Duration: 6h 8 min
+Duration: 6h 11 min
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_books.py", line 499, in test_edit_comments - self.assertEqual(len(self.adv_search({'comments': u'mirä 人'})), 1) - 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 = 'mirä 人' and starts-with(@id, 'comments') ]/.. -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_edit_books.py", line 672, in test_edit_custom_date - self.assertEqual(len(self.adv_search({u'custom_column_2_start': u'16/7/2015'})), 0) - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 2149, in adv_search - self.select_date_with_editor(key, key + '_delete', - File "/home/ozzie/Development/calibre-web-test/test/helper_ui.py", line 1695, in select_date_with_editor - month_year = cls.check_element_on_page((By.CLASS_NAME, 'datepicker-switch')).text.split(' ') -AttributeError: 'bool' object has no attribute 'text'-
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_edit_books_metadata.py", line 128, in test_load_metadata - self.assertEqual(20, len(results)) -AssertionError: 20 != 10+ File "/home/ozzie/Development/calibre-web-test/test/test_edit_books_metadata.py", line 99, in test_load_metadata + if results[cont]['source'] == 'https://comicvine.gamespot.com/': +IndexError: list index out of range
Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_ldap.py", line 330, in test_LDAP_import_memberfield - self.assertEqual(User2rights['email'], ' no_user@thata.org') -TypeError: 'bool' object is not subscriptable-
Traceback (most recent call last): File "/home/ozzie/Development/calibre-web-test/test/test_pip_install.py", line 39, in setUpClass make_release.main(args) - File "/home/ozzie/Development/calibre-web-test/build_release/make_release.py", line 454, in main + File "/home/ozzie/Development/calibre-web-test/build_release/make_release.py", line 456, in main update_requirements() File "/home/ozzie/Development/calibre-web-test/build_release/make_release.py", line 92, in update_requirements with open(os.path.join(FILEPATH, "pyproject.toml"), 'r') as fp: @@ -4631,11 +4554,11 @@ FileNotFoundError: [Errno 2] No such file or directory: '/home/ozzie/Develop -+ TestThumbnails 8 -6 -1 +7 +0 0 1 @@ -4708,31 +4631,11 @@ FileNotFoundError: [Errno 2] No such file or directory: '/home/ozzie/Develop - + @@ -5939,9 +5842,9 @@ AssertionError: 0.0037533645451876575 != 0.0 within 0.0001 delta (0.003753364545 - TestThumbnails - test_sideloaded_book- +- FAIL -- --- - --- -Traceback (most recent call last): - File "/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py", line 317, in test_sideloaded_book - self.assertAlmostEqual(diff(BytesIO(list_cover), BytesIO(old_list_cover), delete_diff_file=True), 0.0, -AssertionError: 0.0037533645451876575 != 0.0 within 0.0001 delta (0.0037533645451876575 difference)-PASS @@ -5970,7 +5873,7 @@ AssertionError: 0.0037533645451876575 != 0.0 within 0.0001 delta (0.003753364545 Total 523 -508 +512 +0 2 -4 9 @@ -6070,6 +5973,12 @@ AssertionError: 0.0037533645451876575 != 0.0 within 0.0001 delta (0.003753364545 Platform -Linux 6.8.0-47-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Oct 2 16:16:55 UTC 2 x86_64 x86_64 +Linux 6.8.0-48-generic #48~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 7 11:24:13 UTC 2 x86_64 x86_64 Basic Basic