posts: store duration of animations and videos.
Start storing the duration of animations and videos in the `duration`
field on the media_assets table. This had to wait until 3d30bfd69 was
deployed, which had to wait until Postgres was upgraded in order to add
the duration column to the media_assets table without downtime.
Also add a fix script to backfill the duration on existing posts. Usage:
TAGS=animated ./script/fixes/079_fix_duration.rb
This commit is contained in:
@@ -28,6 +28,7 @@ class MediaAsset < ApplicationRecord
|
||||
self.file_size = media_file.file_size
|
||||
self.image_width = media_file.width
|
||||
self.image_height = media_file.height
|
||||
self.duration = media_file.duration
|
||||
self.media_metadata = MediaMetadata.new(file: media_file)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user