From f9198d2d4c77720eeed294839d40deb2ba9c83f0 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 3 May 2020 14:09:55 -0700 Subject: [PATCH] Re-use work data for editions --- fedireads/connectors/openlibrary.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fedireads/connectors/openlibrary.py b/fedireads/connectors/openlibrary.py index 649e87c56..473780dd1 100644 --- a/fedireads/connectors/openlibrary.py +++ b/fedireads/connectors/openlibrary.py @@ -78,6 +78,9 @@ class Connector(AbstractConnector): edition_options = self.load_edition_data(olkey).get('entries') edition_data = pick_default_edition(edition_options) + if not edition_data: + # hack: re-use the work data as the edition data + edition_data = work_data key = edition_data.get('key').split('/')[-1] edition = self.create_book(key, edition_data, models.Edition) edition.default = True