diff --git a/app/jobs/image_collage_job.rb b/app/jobs/image_collage_job.rb index 4e3748ec..aa6a8d88 100644 --- a/app/jobs/image_collage_job.rb +++ b/app/jobs/image_collage_job.rb @@ -5,8 +5,10 @@ def perform(entry_id, urls) entry = Entry.where(id: entry_id).first return nil unless entry.present? + entry.update(filepicker_url: "https://dabble-me.s3.amazonaws.com/uploading.png") + filestack_collage_url = collage_from_urls(urls + [entry&.image_url_cdn]) - entry.update(remote_image_url: filestack_collage_url) + entry.update(remote_image_url: filestack_collage_url, filepicker_url: nil) end def collage_from_urls(urls) diff --git a/app/lib/email_processor.rb b/app/lib/email_processor.rb index c0735aef..591aa55c 100644 --- a/app/lib/email_processor.rb +++ b/app/lib/email_processor.rb @@ -132,7 +132,9 @@ def process image_urls = collage_from_attachments([best_attachment]) ImageCollageJob.perform_later(existing_entry.id, image_urls) elsif best_attachment_url.present? + entry.update(filepicker_url: "https://dabble-me.s3.amazonaws.com/uploading.png") existing_entry.remote_image_url = collage_from_urls([best_attachment_url, existing_entry.image_url_cdn]) + existing_entry.filepicker_url = nil end end @@ -154,7 +156,9 @@ def process if best_attachment.present? entry.image = best_attachment elsif best_attachment_url.present? + entry.update(filepicker_url: "https://dabble-me.s3.amazonaws.com/uploading.png") entry.remote_image_url = best_attachment_url + entry.filepicker_url = nil end entry.save rescue ActiveRecord::RecordInvalid => error diff --git a/app/models/entry.rb b/app/models/entry.rb index 8a8ba212..eeca3bcd 100644 --- a/app/models/entry.rb +++ b/app/models/entry.rb @@ -116,6 +116,8 @@ def sanitized_body def image_url_cdn if image.present? image.url + elsif filepicker_url == "https://dabble-me.s3.amazonaws.com/uploading.png" + filepicker_url end end