add filesize to video

dev_unstable
p31729568 6 years ago
parent 0b27fef23d
commit a791e2576d

@ -13,6 +13,7 @@ class Videos::DispatchCallbackService < ApplicationService
case params['EventType'] case params['EventType']
when 'FileUploadComplete' then # 视频上传完成 when 'FileUploadComplete' then # 视频上传完成
video.file_url = params['FileUrl'] video.file_url = params['FileUrl']
video.filesize = params['Size']
video.upload_success video.upload_success
video.save! video.save!
when 'SnapshotComplete' then # 封面截图完成 when 'SnapshotComplete' then # 封面截图完成

@ -0,0 +1,5 @@
class AddFilesizeToVideos < ActiveRecord::Migration[5.2]
def change
add_column :videos, :filesize, :integer, default: 0
end
end
Loading…
Cancel
Save