mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-12 20:48:11 +08:00
Video conversion was happening already for chat videos, but was not updating the chat messages. Now chat messages will be updated with the optimized video.
18 lines
459 B
Ruby
18 lines
459 B
Ruby
# frozen_string_literal: true
|
|
|
|
class OptimizedVideoSerializer < ApplicationSerializer
|
|
attributes :id, :upload_id, :url, :extension, :filesize, :sha1, :original_filename
|
|
|
|
def url
|
|
if object.optimized_upload
|
|
UrlHelper.cook_url(
|
|
object.optimized_upload.url,
|
|
secure: SiteSetting.secure_uploads? && object.optimized_upload.secure,
|
|
)
|
|
end
|
|
end
|
|
|
|
def original_filename
|
|
object.optimized_upload&.original_filename
|
|
end
|
|
end
|