import { SortMeta } from 'primeng/api'
import { switchMap } from 'rxjs/operators'
-import { buildVideoLink, buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
+import { buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
import { environment } from 'src/environments/environment'
import { Component, OnInit } from '@angular/core'
import { DomSanitizer } from '@angular/platform-browser'
import { AdvancedInputFilter } from '@app/shared/shared-forms'
import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
import { VideoBlockService } from '@app/shared/shared-moderation'
+import { buildVideoEmbedLink, decorateVideoLink } from '@shared/core-utils'
import { VideoBlacklist, VideoBlacklistType } from '@shared/models'
@Component({
}
ngOnInit () {
- this.serverService.getConfig()
- .subscribe(config => {
- // don't filter if auto-blacklist is not enabled as this will be the only list
- if (config.autoBlacklist.videos.ofUsers.enabled) {
- this.blocklistTypeFilter = VideoBlacklistType.MANUAL
- }
- })
+ const serverConfig = this.serverService.getHTMLConfig()
+
+ // Don't filter if auto-blacklist is not enabled as this will be the only list
+ if (serverConfig.autoBlacklist.videos.ofUsers.enabled) {
+ this.blocklistTypeFilter = VideoBlacklistType.MANUAL
+ }
this.initialize()
}
}
getVideoUrl (videoBlock: VideoBlacklist) {
- return Video.buildClientUrl(videoBlock.video.uuid)
+ return Video.buildWatchUrl(videoBlock.video)
}
toHtml (text: string) {
getVideoEmbed (entry: VideoBlacklist) {
return buildVideoOrPlaylistEmbed(
- buildVideoLink({
- baseUrl: `${environment.originServerUrl}/videos/embed/${entry.video.uuid}`,
+ decorateVideoLink({
+ url: buildVideoEmbedLink(entry.video, environment.originServerUrl),
+
title: false,
warningTitle: false
}),