mirror of https://github.com/Chocobozzz/PeerTube
Server: add views attribute when sending videos to friends
parent
1f5bf9ef70
commit
e3d156b341
|
@ -155,7 +155,8 @@ function addVideo (req, res, videoFile, finalCallback) {
|
|||
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)
|
||||
|
|
|
@ -91,7 +91,8 @@ function isCommonVideoAttributesValid (video) {
|
|||
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) {
|
||||
|
|
|
@ -380,7 +380,8 @@ function toAddRemoteJSON (callback) {
|
|||
tags: map(self.Tags, 'name'),
|
||||
createdAt: self.createdAt,
|
||||
updatedAt: self.updatedAt,
|
||||
extname: self.extname
|
||||
extname: self.extname,
|
||||
views: self.views
|
||||
}
|
||||
|
||||
return callback(null, remoteVideo)
|
||||
|
@ -398,7 +399,8 @@ function toUpdateRemoteJSON (callback) {
|
|||
tags: map(this.Tags, 'name'),
|
||||
createdAt: this.createdAt,
|
||||
updatedAt: this.updatedAt,
|
||||
extname: this.extname
|
||||
extname: this.extname,
|
||||
views: this.views
|
||||
}
|
||||
|
||||
return json
|
||||
|
|
Loading…
Reference in New Issue