import { SortMeta } from 'primeng/api'
import { switchMap } from 'rxjs/operators'
-import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
import { environment } from 'src/environments/environment'
import { Component, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { AdvancedInputFilter } from '@app/shared/shared-forms'
import { DropdownAction, VideoService } from '@app/shared/shared-main'
import { VideoBlockService } from '@app/shared/shared-moderation'
+import { buildVideoOrPlaylistEmbed } from '@root-helpers/video'
import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils'
import { VideoBlacklist, VideoBlacklistType } from '@shared/models'
title: $localize`Advanced filters`,
children: [
{
- queryParams: { search: 'type:auto' },
+ value: 'type:auto',
label: $localize`Automatic blocks`
},
{
- queryParams: { search: 'type:manual' },
+ value: 'type:manual',
label: $localize`Manual blocks`
}
]
label: $localize`Switch video block to manual`,
handler: videoBlock => {
this.videoBlocklistService.unblockVideo(videoBlock.video.id).pipe(
- switchMap(_ => this.videoBlocklistService.blockVideo(videoBlock.video.id, undefined, true))
+ switchMap(_ => this.videoBlocklistService.blockVideo([ { videoId: videoBlock.video.id, unfederate: true } ]))
).subscribe({
next: () => {
this.notifier.success($localize`Video ${videoBlock.video.name} switched to manual block.`)
this.videoService.removeVideo(videoBlock.video.id)
.subscribe({
- next: () => this.notifier.success($localize`Video deleted.`),
+ next: () => {
+ this.notifier.success($localize`Video deleted.`)
+ this.reloadData()
+ },
error: err => this.notifier.error(err.message)
})
}
getVideoEmbed (entry: VideoBlacklist) {
- return buildVideoOrPlaylistEmbed(
- decorateVideoLink({
+ return buildVideoOrPlaylistEmbed({
+ embedUrl: decorateVideoLink({
url: buildVideoEmbedLink(entry.video, environment.originServerUrl),
title: false,
warningTitle: false
}),
- entry.video.name
- )
+ embedTitle: entry.video.name
+ })
}
protected reloadData () {