]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/redundancy.ts
Move engines outside package.json
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / redundancy.ts
index 6d2dd39c97a5cccd036715af826510c8f93b3724..c379aebe491f9b376f1e7d0f3bcee4521037d731 100644 (file)
@@ -130,8 +130,12 @@ const addVideoRedundancyValidator = [
 
     if (res.locals.onlyVideo.remote === false) {
       return res.status(HttpStatusCode.BAD_REQUEST_400)
-                .json({ error: 'Cannot create a redundancy on a local video' })
-                .end()
+        .json({ error: 'Cannot create a redundancy on a local video' })
+    }
+
+    if (res.locals.onlyVideo.isLive) {
+      return res.status(HttpStatusCode.BAD_REQUEST_400)
+        .json({ error: 'Cannot create a redundancy of a live video' })
     }
 
     const alreadyExists = await VideoRedundancyModel.isLocalByVideoUUIDExists(res.locals.onlyVideo.uuid)