Don't try to display ugoira thumbnail/webm before they exist
This commit is contained in:
@@ -154,7 +154,7 @@ class Post < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def has_ugoira_webm?
|
def has_ugoira_webm?
|
||||||
created_at < 1.minute.ago || File.exists?(preview_file_path)
|
created_at < 1.minute.ago || (File.exists?(preview_file_path) && File.size(preview_file_path) > 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<% if CurrentUser.user.default_image_size == "large" && params[:original].blank? %>
|
<% if CurrentUser.user.default_image_size == "large" && params[:original].blank? && post.has_ugoira_webm? %>
|
||||||
<%= render "posts/partials/show/ugoira_webm", :post => post %>
|
<%= render "posts/partials/show/ugoira_webm", :post => post %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= render "posts/partials/show/ugoira_original", :post => post %>
|
<%= render "posts/partials/show/ugoira_original", :post => post %>
|
||||||
|
|||||||
Reference in New Issue
Block a user