diff --git a/fedireads/status.py b/fedireads/status.py index 6cbc5acd..7d6f6b66 100644 --- a/fedireads/status.py +++ b/fedireads/status.py @@ -8,14 +8,16 @@ from fedireads.sanitize_html import InputHtmlParser def create_review_from_activity(author, activity): ''' parse an activity json blob into a status ''' - book = activity['inReplyToBook'] - book = book.split('/')[-1] + book_id = activity['inReplyToBook'] + book_id = book_id.split('/')[-1] name = activity.get('name') rating = activity.get('rating') content = activity.get('content') published = activity.get('published') remote_id = activity['id'] + book = get_or_create_book(book_id) + review = create_review(author, book, name, content, rating) review.published_date = published review.remote_id = remote_id