Skip to content

Commit

Permalink
Update video duration
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyendacthienngan committed Dec 31, 2021
1 parent 4c07de4 commit e174bad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions controllers/new-videos.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ async function saveVideoToDatabase (newFilePath, body, recognizedMusics) {
"title": body.title,
"size": fileSize,
"description": body.description,
"duration": body.duration,
"url": base,
"recognition_result": recognizedMusics,
}
Expand Down
3 changes: 2 additions & 1 deletion controllers/video-info.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ exports.updateVideoInfo = async function (req, res) {
description : body.description,
url : body.url,
size : body.size,
visibility : body.visibility
visibility : body.visibility,
duration: body.duration
});
res.send(video);
} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion models/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const videoSchema = new Schema ({
total_likes: { type: Number, default: 0, required: true },
total_comments: { type: Number, default: 0, required: true },
total_views: { type: Number, default: 0, required: true },
visibility: { type: Number, default: 0, required: true }, // 0: public, 1: private, 2: followers
visibility: { type: Number, default: 0, required: true }, // 0: public, 1: private, 2: followers,
duration: { type: String }
}, schemaOptions);

module.exports.Video = mongoose.model('Video', videoSchema)

0 comments on commit e174bad

Please sign in to comment.