defer to cdn for cropped thumbnails
This commit is contained in:
@@ -172,7 +172,11 @@ class Post < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
if has_cropped? && !CurrentUser.disable_cropped_thumbnails?
|
if has_cropped? && !CurrentUser.disable_cropped_thumbnails?
|
||||||
"https://s3.amazonaws.com/#{Danbooru.config.aws_s3_bucket_name}/cropped/small/#{md5}.jpg"
|
if Danbooru.config.use_s3_proxy?(self)
|
||||||
|
"/cached/data/cropped/small/#{md5}.jpg"
|
||||||
|
else
|
||||||
|
"https://s3.amazonaws.com/#{Danbooru.config.aws_s3_bucket_name}/cropped/small/#{md5}.jpg"
|
||||||
|
end
|
||||||
else
|
else
|
||||||
"/data/preview/#{file_path_prefix}#{md5}.jpg"
|
"/data/preview/#{file_path_prefix}#{md5}.jpg"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user