forked from mirrors/bookwyrm
Fixes error when librarything csv is missing isbn
This commit is contained in:
parent
a58d600030
commit
5b192d1b3d
1 changed files with 2 additions and 1 deletions
|
@ -14,7 +14,8 @@ class LibrarythingImporter(Importer):
|
|||
"""use the dataclass to create the formatted row of data"""
|
||||
remove_brackets = lambda v: re.sub(r"\[|\]", "", v) if v else None
|
||||
normalized = {k: remove_brackets(entry.get(v)) for k, v in mappings.items()}
|
||||
isbn_13 = normalized["isbn_13"].split(", ")
|
||||
isbn_13 = normalized.get("isbn_13")
|
||||
isbn_13 = isbn_13.split(", ") if isbn_13 else []
|
||||
normalized["isbn_13"] = isbn_13[1] if len(isbn_13) > 0 else None
|
||||
return normalized
|
||||
|
||||
|
|
Loading…
Reference in a new issue