for video/ugoira, don't render preview if file doesn't exist yet

This commit is contained in:
r888888888
2017-11-21 10:15:52 -08:00
parent f8581c8113
commit 902f657a5d

View File

@@ -254,7 +254,9 @@ class Post < ApplicationRecord
end
def has_preview?
is_image? || is_video? || is_ugoira?
# for video/ugoira we don't want to try and render a preview that
# might doesn't exist yet
is_image? || ((is_video? || is_ugoira?) && File.exists?(preview_file_path))
end
def has_dimensions?