From 35bf0c83c80f59ca79f4b84fac8700f17adeb22d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 10 Oct 2017 10:02:18 +0200 Subject: Video blacklist refractoring --- .../app/videos/+video-watch/video-watch.component.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'client/src/app/videos/+video-watch/video-watch.component.ts') diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 874dd5997..bd98e877c 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -14,7 +14,7 @@ import { VideoMagnetComponent } from './video-magnet.component' import { VideoShareComponent } from './video-share.component' import { VideoReportComponent } from './video-report.component' import { Video, VideoService } from '../shared' -import { WebTorrentService } from './webtorrent.service' +import { VideoBlacklistService } from '../../shared' import { UserVideoRateType, VideoRateType } from '../../../../../shared' @Component({ @@ -45,6 +45,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { private route: ActivatedRoute, private router: Router, private videoService: VideoService, + private videoBlacklistService: VideoBlacklistService, private confirmService: ConfirmService, private metaService: MetaService, private authService: AuthService, @@ -137,15 +138,15 @@ export class VideoWatchComponent implements OnInit, OnDestroy { res => { if (res === false) return - this.videoService.blacklistVideo(this.video.id) - .subscribe( - status => { - this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) - this.router.navigate(['/videos/list']) - }, + this.videoBlacklistService.blacklistVideo(this.video.id) + .subscribe( + status => { + this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) + this.router.navigate(['/videos/list']) + }, - error => this.notificationsService.error('Error', error.text) - ) + error => this.notificationsService.error('Error', error.text) + ) } ) } -- cgit v1.2.3