ngOnChanges () {
if (this.loaded) {
this.loaded = false
- this.playlistAdd.reload()
+ if (this.playlistAdd) this.playlistAdd.reload()
}
this.buildActions()
}
canVideoBeDuplicated () {
- return this.video.canBeDuplicatedBy(this.user)
+ return !this.video.isLive && this.video.canBeDuplicatedBy(this.user)
}
isVideoAccountMutable () {
if (res === false) return
this.videoBlocklistService.unblockVideo(this.video.id)
- .subscribe(
- () => {
+ .subscribe({
+ next: () => {
this.notifier.success($localize`Video ${this.video.name} unblocked.`)
this.video.blacklisted = false
this.videoUnblocked.emit()
},
- err => this.notifier.error(err.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
async removeVideo () {
if (res === false) return
this.videoService.removeVideo(this.video.id)
- .subscribe(
- () => {
+ .subscribe({
+ next: () => {
this.notifier.success($localize`Video ${this.video.name} deleted.`)
this.videoRemoved.emit()
},
- error => this.notifier.error(error.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
duplicateVideo () {
this.redundancyService.addVideoRedundancy(this.video)
- .subscribe(
- () => {
+ .subscribe({
+ next: () => {
const message = $localize`This video will be duplicated by your instance.`
this.notifier.success(message)
},
- err => this.notifier.error(err.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
muteVideoAccount () {
const params = { nameWithHost: Actor.CREATE_BY_STRING(this.video.account.name, this.video.account.host) }
this.blocklistService.blockAccountByUser(params)
- .subscribe(
- () => {
+ .subscribe({
+ next: () => {
this.notifier.success($localize`Account ${params.nameWithHost} muted.`)
this.videoAccountMuted.emit()
},
- err => this.notifier.error(err.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
onVideoBlocked () {
{
label: $localize`Display live information`,
handler: ({ video }) => this.showLiveInfoModal(video),
- isDisplayed: () => this.isVideoLiveInfoAvailable(),
+ isDisplayed: () => this.displayOptions.liveInfo && this.isVideoLiveInfoAvailable(),
iconName: 'live'
},
{