Skip to content

Commit

Permalink
Prioritize loading images for demo
Browse files Browse the repository at this point in the history
Co-authored-by: Bess Sadler <bess@users.noreply.github.com>
  • Loading branch information
leefaisonr and bess committed Oct 2, 2023
1 parent 58c3ccc commit 0448396
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/services/card_image_loading_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ def import_guide_card_images
end
end

def prioritized_image_loading(path)
image_array = image_array(path)
image_array.each do |image|
ci = CardImage.find_by(path:, image_name: image)
next if ci

ci = CardImage.new
ci.path = path
ci.image_name = image
ci.save
end
end

# returns something like
# ["imagecat-disk9-0091-A3037-1358.0110.tif", "imagecat-disk9-0091-A3037-1358.0111.tif"]
def image_array(path)
Expand Down

0 comments on commit 0448396

Please sign in to comment.