use full file url for open graph url if a file doesn't have a large version

This commit is contained in:
r888888888
2017-12-15 11:30:26 -08:00
parent 3ce8f6e7df
commit 4dabbde05d

View File

@@ -201,8 +201,12 @@ class Post < ApplicationRecord
end
def open_graph_image_url
if is_image? && has_large?
"http://#{Danbooru.config.hostname}#{large_file_url}"
if is_image?
if has_large?
"http://#{Danbooru.config.hostname}#{large_file_url}"
else
"http://#{Danbooru.config.hostname}#{file_url}"
end
else
complete_preview_file_url
end