Skip to content

Commit

Permalink
Remove old essence picture thumbnails rake tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Jan 22, 2023
1 parent c1037dd commit e59db6d
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions lib/tasks/alchemy/thumbnails.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

namespace :alchemy do
namespace :generate do
desc "Generates all thumbnails for Alchemy Pictures and EssencePictures."
desc "Generates all thumbnails for Alchemy Pictures and Picture Ingredients."
task thumbnails: [
"alchemy:generate:picture_thumbnails",
"alchemy:generate:essence_picture_thumbnails",
"alchemy:generate:ingredient_picture_thumbnails",
]

Expand All @@ -23,24 +22,6 @@ namespace :alchemy do
puts "Done!"
end

desc "Generates thumbnails for Alchemy EssencePictures."
task essence_picture_thumbnails: :environment do
essence_pictures = Alchemy::EssencePicture.joins(:content, :ingredient_association)
puts "Regenerate #{essence_pictures.count} essence picture thumbnails."
puts "Please wait..."

essence_pictures.find_each do |essence_picture|
puts essence_picture.picture_url
puts essence_picture.thumbnail_url

essence_picture.settings.fetch(:srcset, []).each do |src|
puts essence_picture.picture_url(src)
end
end

puts "Done!"
end

desc "Generates thumbnails for Alchemy Picture Ingredients (set ELEMENTS=element1,element2 to only generate thumbnails for a subset of elements)."
task ingredient_picture_thumbnails: :environment do
ingredient_pictures = Alchemy::Ingredients::Picture.
Expand Down

0 comments on commit e59db6d

Please sign in to comment.