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

@@ -1235,12 +1235,12 @@ - + TestEditBooks 38 - 35 + 37 + 0 0 - 2 1 Detail @@ -1276,44 +1276,11 @@ - +
TestEditBooks - test_edit_comments
- -
- ERROR -
- - - - + PASS @@ -1345,35 +1312,11 @@ dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16 - +
TestEditBooks - test_edit_custom_date
- -
- ERROR -
- - - - + PASS @@ -2122,12 +2065,12 @@ AttributeError: 'bool' object has no attribute 'text' - + TestLoadMetadata 1 0 - 1 0 + 1 0 Detail @@ -2136,26 +2079,26 @@ AttributeError: 'bool' object has no attribute 'text' - +
TestLoadMetadata - test_load_metadata
- FAIL + ERROR
-