DEV: Remove diffhtml_preview for video thumbnails (#20865)

Video thumbnail generation is no longer dependent on
`enable_diffhtml_preview` being enabled.
This commit is contained in:
Blake Erickson 2023-03-28 12:38:50 -06:00 committed by GitHub
parent 2a7bdb2d66
commit aa09a78d14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -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

View File

@ -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) }