Skip to content

Commit

Permalink
Merge pull request #2169 from bookwyrm-social/inventaire-import
Browse files Browse the repository at this point in the history
Handle getting edition data as dict or string
  • Loading branch information
mouse-reeve committed Jul 3, 2022
2 parents 0b900dc + 5d363da commit 58b23a7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions bookwyrm/connectors/inventaire.py
Expand Up @@ -160,12 +160,13 @@ def expand_book_data(self, book):

def create_edition_from_data(self, work, edition_data, instance=None):
"""pass in the url as data and then call the version in abstract connector"""
try:
data = self.get_book_data(edition_data)
except ConnectorException:
# who, indeed, knows
return
super().create_edition_from_data(work, data, instance=instance)
if isinstance(edition_data, str):
try:
edition_data = self.get_book_data(edition_data)
except ConnectorException:
# who, indeed, knows
return
super().create_edition_from_data(work, edition_data, instance=instance)

def get_cover_url(self, cover_blob, *_):
"""format the relative cover url into an absolute one:
Expand Down

0 comments on commit 58b23a7

Please sign in to comment.