refactor cropped images into explore/posts/intro
This commit is contained in:
@@ -142,6 +142,15 @@ class Post < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
# this is for the 640x320 version
|
||||
def cropped_file_url
|
||||
if Danbooru.config.use_s3_proxy?(self)
|
||||
"/cached/data/cropped/large/#{md5}.jpg"
|
||||
else
|
||||
"/data/cropped/large/#{md5}.jpg"
|
||||
end
|
||||
end
|
||||
|
||||
def large_file_url
|
||||
if has_large?
|
||||
if Danbooru.config.use_s3_proxy?(self)
|
||||
|
||||
@@ -200,9 +200,8 @@ class Upload < ApplicationRecord
|
||||
end
|
||||
|
||||
def notify_cropper(post)
|
||||
if Danbooru.config.aws_sqs_cropper_url && is_image?
|
||||
sqs = SqsService.new(Danbooru.config.aws_sqs_cropper_url)
|
||||
sqs.send_message("#{post.id},https://#{Danbooru.config.hostname}/data/#{post.md5}.#{post.file_ext}")
|
||||
if ImageCropper.enabled?
|
||||
ImageCropper.notify(post)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user