1
0
Fork 0

Don't allow manual redundancy of live videos

This commit is contained in:
Chocobozzz 2020-12-07 15:08:12 +01:00
parent 8e0a2f2a05
commit 17b7d4b315
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 7 additions and 3 deletions

View File

@ -167,7 +167,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
}
canVideoBeDuplicated () {
return this.video.canBeDuplicatedBy(this.user)
return !this.video.isLive && this.video.canBeDuplicatedBy(this.user)
}
isVideoAccountMutable () {

View 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)