add rake task for finding missing ads
This commit is contained in:
@@ -19,6 +19,15 @@ namespace :images do
|
|||||||
post.distribute_files
|
post.distribute_files
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "Finds advertisement images that don't exist"
|
||||||
|
task :find_missing_ads => :environment do
|
||||||
|
Advertisement.where("status = 'active'").each do |ad|
|
||||||
|
if !File.exists?(ad.image_path)
|
||||||
|
puts ad.image_path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
desc "Generate thumbnail-sized images of posts"
|
desc "Generate thumbnail-sized images of posts"
|
||||||
task :generate_preview => :environment do
|
task :generate_preview => :environment do
|
||||||
Post.where("image_width > ?", Danbooru.config.small_image_width).find_each do |post|
|
Post.where("image_width > ?", Danbooru.config.small_image_width).find_each do |post|
|
||||||
|
|||||||
Reference in New Issue
Block a user