aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/custom-validators/activitypub/videos.ts2
-rw-r--r--server/helpers/middlewares/videos.ts4
2 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts
index 7ff551ecd..cb385b07d 100644
--- a/server/helpers/custom-validators/activitypub/videos.ts
+++ b/server/helpers/custom-validators/activitypub/videos.ts
@@ -63,6 +63,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
63 if (!isBooleanValid(video.downloadEnabled)) video.downloadEnabled = true 63 if (!isBooleanValid(video.downloadEnabled)) video.downloadEnabled = true
64 if (!isBooleanValid(video.commentsEnabled)) video.commentsEnabled = false 64 if (!isBooleanValid(video.commentsEnabled)) video.commentsEnabled = false
65 if (!isBooleanValid(video.isLiveBroadcast)) video.isLiveBroadcast = false 65 if (!isBooleanValid(video.isLiveBroadcast)) video.isLiveBroadcast = false
66 if (!isBooleanValid(video.liveSaveReplay)) video.liveSaveReplay = false
66 67
67 return isActivityPubUrlValid(video.id) && 68 return isActivityPubUrlValid(video.id) &&
68 isVideoNameValid(video.name) && 69 isVideoNameValid(video.name) &&
@@ -79,7 +80,6 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
79 isDateValid(video.updated) && 80 isDateValid(video.updated) &&
80 (!video.originallyPublishedAt || isDateValid(video.originallyPublishedAt)) && 81 (!video.originallyPublishedAt || isDateValid(video.originallyPublishedAt)) &&
81 (!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) && 82 (!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) &&
82 video.url.length !== 0 &&
83 video.attributedTo.length !== 0 83 video.attributedTo.length !== 0
84} 84}
85 85
diff --git a/server/helpers/middlewares/videos.ts b/server/helpers/middlewares/videos.ts
index 77a48a467..3904f762a 100644
--- a/server/helpers/middlewares/videos.ts
+++ b/server/helpers/middlewares/videos.ts
@@ -92,9 +92,9 @@ async function doesVideoChannelOfAccountExist (channelId: number, user: MUserAcc
92 return true 92 return true
93} 93}
94 94
95function checkUserCanManageVideo (user: MUser, video: MVideoAccountLight, right: UserRight, res: Response) { 95function checkUserCanManageVideo (user: MUser, video: MVideoAccountLight, right: UserRight, res: Response, onlyOwned = true) {
96 // Retrieve the user who did the request 96 // Retrieve the user who did the request
97 if (video.isOwned() === false) { 97 if (onlyOwned && video.isOwned() === false) {
98 res.status(403) 98 res.status(403)
99 .json({ error: 'Cannot manage a video of another server.' }) 99 .json({ error: 'Cannot manage a video of another server.' })
100 .end() 100 .end()