Don't allow manual redundancy of live videos
This commit is contained in:
parent
8e0a2f2a05
commit
17b7d4b315
2 changed files with 7 additions and 3 deletions
|
@ -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 () {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue