diff --git a/app/services/videos/dispatch_callback_service.rb b/app/services/videos/dispatch_callback_service.rb index 3bdabd91a..e4ad1628a 100644 --- a/app/services/videos/dispatch_callback_service.rb +++ b/app/services/videos/dispatch_callback_service.rb @@ -13,6 +13,7 @@ class Videos::DispatchCallbackService < ApplicationService case params['EventType'] when 'FileUploadComplete' then # 视频上传完成 video.file_url = params['FileUrl'] + video.filesize = params['Size'] video.upload_success video.save! when 'SnapshotComplete' then # 封面截图完成 diff --git a/db/migrate/20190819081514_add_filesize_to_videos.rb b/db/migrate/20190819081514_add_filesize_to_videos.rb new file mode 100644 index 000000000..da5b6fb50 --- /dev/null +++ b/db/migrate/20190819081514_add_filesize_to_videos.rb @@ -0,0 +1,5 @@ +class AddFilesizeToVideos < ActiveRecord::Migration[5.2] + def change + add_column :videos, :filesize, :integer, default: 0 + end +end