defer to cdn for cropped thumbnails

This commit is contained in:
r888888888
2017-09-08 16:49:50 -07:00
parent 68863ed018
commit 99e38c9e95

View File

@@ -172,7 +172,11 @@ class Post < ApplicationRecord
end
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
"/data/preview/#{file_path_prefix}#{md5}.jpg"
end