Skip to content

Commit

Permalink
Don't include loading image in collages for existing photos
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed Jan 15, 2024
1 parent b2a0068 commit 695b84b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/jobs/image_collage_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ def perform(entry_id, urls)

entry.update(filepicker_url: "https://dabble-me.s3.amazonaws.com/uploading.png")

filestack_collage_url = collage_from_urls(urls + [entry&.image_url_cdn])
existing_url = entry&.image_url_cdn == "https://dabble-me.s3.amazonaws.com/uploading.png" ? nil : entry&.image_url_cdn

filestack_collage_url = collage_from_urls(urls + [existing_url])
entry.update(remote_image_url: filestack_collage_url, filepicker_url: nil)
end

Expand Down
3 changes: 2 additions & 1 deletion app/lib/email_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def process
ImageCollageJob.perform_later(existing_entry.id, image_urls)
elsif best_attachment_url.present?
existing_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_image = existing_entry.image_url_cdn == "https://dabble-me.s3.amazonaws.com/uploading.png" ? nil : existing_entry.image_url_cdn
existing_entry.remote_image_url = collage_from_urls([best_attachment_url, existing_image])
existing_entry.filepicker_url = nil
end
end
Expand Down

0 comments on commit 695b84b

Please sign in to comment.