From aa09a78d1432922f61c65f0489acef2cc2289698 Mon Sep 17 00:00:00 2001 From: Blake Erickson Date: Tue, 28 Mar 2023 12:38:50 -0600 Subject: [PATCH] DEV: Remove diffhtml_preview for video thumbnails (#20865) Video thumbnail generation is no longer dependent on `enable_diffhtml_preview` being enabled. --- app/models/post.rb | 3 +-- spec/models/post_spec.rb | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/models/post.rb b/app/models/post.rb index e6f9dec0c25..4b1ba463a05 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -1009,8 +1009,7 @@ class Post < ActiveRecord::Base upload ||= Upload.get_from_url(src) # Link any video thumbnails - if SiteSetting.enable_diffhtml_preview && upload.present? && - (FileHelper.supported_video.include? upload.extension) + if upload.present? && (FileHelper.supported_video.include? upload.extension) # Video thumbnails have the filename of the video file sha1 with a .png or .jpg extension. # This is because at time of upload in the composer we don't know the topic/post id yet # and there is no thumbnail info added to the markdown to tie the thumbnail to the topic/post after diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index 4b2f6f7c51b..c61a96b1d29 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -1532,8 +1532,6 @@ RSpec.describe Post do end describe "video_thumbnails" do - before { SiteSetting.enable_diffhtml_preview = true } - fab!(:video_upload) { Fabricate(:upload, extension: "mp4") } fab!(:image_upload) { Fabricate(:upload) } fab!(:image_upload_2) { Fabricate(:upload) }