Address #3415: og:image meta tags can point to video files.

This commit is contained in:
evazion
2017-12-06 09:01:13 -06:00
parent acd49be4cc
commit 131c0109d4
2 changed files with 10 additions and 2 deletions

View File

@@ -196,6 +196,14 @@ class Post < ApplicationRecord
"http://#{Danbooru.config.hostname}#{preview_file_url}"
end
def open_graph_image_url
if is_image? && has_large?
"http://#{Danbooru.config.hostname}#{large_file_url}"
else
complete_preview_file_url
end
end
def file_url_for(user)
if CurrentUser.mobile_mode?
large_file_url