Import with LL # failing due to bookid getting cleared out
Small patch to fix import with LL # failing 'cause bookid is getting cleared. I believe if bookid is already set, we can skip trying to locate the book by title / author.
--- postprocess.py.orig 2023-04-24 08:19:24.788606282 -0500
+++ postprocess.py 2023-04-24 08:22:15.532609357 -0500
@@ -373,6 +373,7 @@
process_alternate(subdir, library=library, automerge=automerge)
metadata = {}
+ bookid = None
if "LL.(" in source_dir:
bookid = source_dir.split("LL.(")[1].split(")")[0]
db = database.DBConnection()
@@ -454,13 +455,12 @@
metadata['creator'] = author
metadata['title'] = book
- if 'title' in metadata and 'creator' in metadata:
+ if bookid is None and 'title' in metadata and 'creator' in metadata:
authorname = metadata['creator']
bookname = metadata['title']
db = database.DBConnection()
try:
authorid = ''
- bookid = ''
results = []
authmatch = db.match('SELECT * FROM authors where AuthorName=?', (authorname,))
Edited by Rupa Schomaker