diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 2 | ||||
-rw-r--r-- | server/tests/api/check-params/live.ts | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index ea6bd0721..d3014e8e7 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -234,7 +234,7 @@ const videosUpdateValidator = getCommonVideoEditAttributes().concat([ | |||
234 | if (!await doesVideoExist(req.params.id, res)) return cleanUpReqFiles(req) | 234 | if (!await doesVideoExist(req.params.id, res)) return cleanUpReqFiles(req) |
235 | 235 | ||
236 | const video = getVideoWithAttributes(res) | 236 | const video = getVideoWithAttributes(res) |
237 | if (req.body.privacy && video.isLive && video.state !== VideoState.WAITING_FOR_LIVE) { | 237 | if (video.isLive && video.privacy !== req.body.privacy && video.state !== VideoState.WAITING_FOR_LIVE) { |
238 | return res.fail({ message: 'Cannot update privacy of a live that has already started' }) | 238 | return res.fail({ message: 'Cannot update privacy of a live that has already started' }) |
239 | } | 239 | } |
240 | 240 | ||
diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts index 81f10ed8e..2dc735c23 100644 --- a/server/tests/api/check-params/live.ts +++ b/server/tests/api/check-params/live.ts | |||
@@ -553,9 +553,15 @@ describe('Test video lives API validator', function () { | |||
553 | const ffmpegCommand = sendRTMPStream({ rtmpBaseUrl: live.rtmpUrl, streamKey: live.streamKey }) | 553 | const ffmpegCommand = sendRTMPStream({ rtmpBaseUrl: live.rtmpUrl, streamKey: live.streamKey }) |
554 | 554 | ||
555 | await command.waitUntilPublished({ videoId: video.id }) | 555 | await command.waitUntilPublished({ videoId: video.id }) |
556 | |||
557 | await server.videos.update({ | ||
558 | id: video.id, | ||
559 | attributes: { privacy: VideoPrivacy.PUBLIC } // Same privacy, it's fine | ||
560 | }) | ||
561 | |||
556 | await server.videos.update({ | 562 | await server.videos.update({ |
557 | id: video.id, | 563 | id: video.id, |
558 | attributes: { privacy: VideoPrivacy.PUBLIC }, | 564 | attributes: { privacy: VideoPrivacy.UNLISTED }, |
559 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 | 565 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 |
560 | }) | 566 | }) |
561 | 567 | ||