extname: path.extname(videoFile.filename),
description: videoInfos.description,
duration: videoFile.duration,
- authorId: author.id
+ authorId: author.id,
+ views: videoInfos.views
}
const video = db.Video.build(videoData)
videosValidators.isVideoNameValid(video.name) &&
videosValidators.isVideoTagsValid(video.tags) &&
videosValidators.isVideoRemoteIdValid(video.remoteId) &&
- videosValidators.isVideoExtnameValid(video.extname)
+ videosValidators.isVideoExtnameValid(video.extname) &&
+ videosValidators.isVideoViewsValid(video.views)
}
function isRequestTypeAddValid (value) {
tags: map(self.Tags, 'name'),
createdAt: self.createdAt,
updatedAt: self.updatedAt,
- extname: self.extname
+ extname: self.extname,
+ views: self.views
}
return callback(null, remoteVideo)
tags: map(this.Tags, 'name'),
createdAt: this.createdAt,
updatedAt: this.updatedAt,
- extname: this.extname
+ extname: this.extname,
+ views: this.views
}
return json