aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-07 15:08:12 +0100
committerChocobozzz <me@florianbigard.com>2020-12-07 16:07:52 +0100
commit17b7d4b315ee958acd52d27d0bc4133164bca254 (patch)
tree719b7812e126f81c1e8a0da4e6e77695b7894294 /server
parent8e0a2f2a05df23c30abb21cfbd540fc289c33b91 (diff)
downloadPeerTube-17b7d4b315ee958acd52d27d0bc4133164bca254.tar.gz
PeerTube-17b7d4b315ee958acd52d27d0bc4133164bca254.tar.zst
PeerTube-17b7d4b315ee958acd52d27d0bc4133164bca254.zip
Don't allow manual redundancy of live videos
Diffstat (limited to 'server')
-rw-r--r--server/middlewares/validators/redundancy.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/middlewares/validators/redundancy.ts b/server/middlewares/validators/redundancy.ts
index 6d2dd39c9..c379aebe4 100644
--- a/server/middlewares/validators/redundancy.ts
+++ b/server/middlewares/validators/redundancy.ts
@@ -130,8 +130,12 @@ const addVideoRedundancyValidator = [
130 130
131 if (res.locals.onlyVideo.remote === false) { 131 if (res.locals.onlyVideo.remote === false) {
132 return res.status(HttpStatusCode.BAD_REQUEST_400) 132 return res.status(HttpStatusCode.BAD_REQUEST_400)
133 .json({ error: 'Cannot create a redundancy on a local video' }) 133 .json({ error: 'Cannot create a redundancy on a local video' })
134 .end() 134 }
135
136 if (res.locals.onlyVideo.isLive) {
137 return res.status(HttpStatusCode.BAD_REQUEST_400)
138 .json({ error: 'Cannot create a redundancy of a live video' })
135 } 139 }
136 140
137 const alreadyExists = await VideoRedundancyModel.isLocalByVideoUUIDExists(res.locals.onlyVideo.uuid) 141 const alreadyExists = await VideoRedundancyModel.isLocalByVideoUUIDExists(res.locals.onlyVideo.uuid)