Fix a regression in previous release that broke copying of book to another library if the books author does not exist in the destination database.

This commit is contained in:
Kovid Goyal 2024-09-28 09:41:06 +05:30
parent 8d95d74355
commit f0e42c3bf3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -286,7 +286,7 @@ class ManyToOneTable(Table):
for iid, name in self.id_map.items():
if icu_lower(name) == q:
return {item_names[0]: iid}
return {item_names[0]: iid}
return {item_names[0]: None}
rmap = {icu_lower(v) if isinstance(v, str) else v:k for k, v in self.id_map.items()}
return {name: rmap.get(icu_lower(name) if isinstance(name, str) else name, None) for name in item_names}