diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-10 10:02:18 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-10 10:18:16 +0200 |
commit | 35bf0c83c80f59ca79f4b84fac8700f17adeb22d (patch) | |
tree | a9b2106096d6ba04d7219051b17fd32cfbe6a885 /client/src/app/videos/+video-watch/video-watch.component.ts | |
parent | 769d332177a5b02d5c2ffc134687d3b4ed65bae9 (diff) | |
download | PeerTube-35bf0c83c80f59ca79f4b84fac8700f17adeb22d.tar.gz PeerTube-35bf0c83c80f59ca79f4b84fac8700f17adeb22d.tar.zst PeerTube-35bf0c83c80f59ca79f4b84fac8700f17adeb22d.zip |
Video blacklist refractoring
Diffstat (limited to 'client/src/app/videos/+video-watch/video-watch.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 19 |
1 files changed, 10 insertions, 9 deletions
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' | |||
14 | import { VideoShareComponent } from './video-share.component' | 14 | import { VideoShareComponent } from './video-share.component' |
15 | import { VideoReportComponent } from './video-report.component' | 15 | import { VideoReportComponent } from './video-report.component' |
16 | import { Video, VideoService } from '../shared' | 16 | import { Video, VideoService } from '../shared' |
17 | import { WebTorrentService } from './webtorrent.service' | 17 | import { VideoBlacklistService } from '../../shared' |
18 | import { UserVideoRateType, VideoRateType } from '../../../../../shared' | 18 | import { UserVideoRateType, VideoRateType } from '../../../../../shared' |
19 | 19 | ||
20 | @Component({ | 20 | @Component({ |
@@ -45,6 +45,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
45 | private route: ActivatedRoute, | 45 | private route: ActivatedRoute, |
46 | private router: Router, | 46 | private router: Router, |
47 | private videoService: VideoService, | 47 | private videoService: VideoService, |
48 | private videoBlacklistService: VideoBlacklistService, | ||
48 | private confirmService: ConfirmService, | 49 | private confirmService: ConfirmService, |
49 | private metaService: MetaService, | 50 | private metaService: MetaService, |
50 | private authService: AuthService, | 51 | private authService: AuthService, |
@@ -137,15 +138,15 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
137 | res => { | 138 | res => { |
138 | if (res === false) return | 139 | if (res === false) return |
139 | 140 | ||
140 | this.videoService.blacklistVideo(this.video.id) | 141 | this.videoBlacklistService.blacklistVideo(this.video.id) |
141 | .subscribe( | 142 | .subscribe( |
142 | status => { | 143 | status => { |
143 | this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) | 144 | this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) |
144 | this.router.navigate(['/videos/list']) | 145 | this.router.navigate(['/videos/list']) |
145 | }, | 146 | }, |
146 | 147 | ||
147 | error => this.notificationsService.error('Error', error.text) | 148 | error => this.notificationsService.error('Error', error.text) |
148 | ) | 149 | ) |
149 | } | 150 | } |
150 | ) | 151 | ) |
151 | } | 152 | } |