Change how goodread import writes reviews

- adds published date
 - broadcasts review imports
 - completes review and shelve actions as it goes
 - some small connector fixes

 fixes #247
This commit is contained in:
Mouse Reeve
2020-10-29 14:29:31 -07:00
parent 7febcec229
commit a46d7f5dc7
5 changed files with 67 additions and 57 deletions

View File

@ -42,13 +42,10 @@ def import_data(job_id):
if item.book:
item.save()
results.append(item)
# shelves book and handles reviews
outgoing.handle_imported_book(job.user, item)
else:
item.fail_reason = "Could not match book on OpenLibrary"
item.fail_reason = "Could not find a match for book"
item.save()
status = outgoing.handle_import_books(job.user, results)
if status:
job.import_status = status
job.save()
finally:
create_notification(job.user, 'IMPORT', related_import=job)