From dedc7abb7beccb0b3a4a4fa4e8ccfef8ceecd5a6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 4 Sep 2019 15:03:50 +0200 Subject: Fix auto blacklist view --- client/src/app/shared/video-blacklist/video-blacklist.service.ts | 9 +++++---- client/src/app/shared/video/video-miniature.component.html | 2 +- client/src/app/shared/video/video-miniature.component.ts | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'client/src') diff --git a/client/src/app/shared/video-blacklist/video-blacklist.service.ts b/client/src/app/shared/video-blacklist/video-blacklist.service.ts index a9eab9b6f..d65da85fe 100644 --- a/client/src/app/shared/video-blacklist/video-blacklist.service.ts +++ b/client/src/app/shared/video-blacklist/video-blacklist.service.ts @@ -34,7 +34,7 @@ export class VideoBlacklistService { ) } - getAutoBlacklistedAsVideoList (videoPagination: ComponentPagination): Observable<{ videos: Video[], totalVideos: number}> { + getAutoBlacklistedAsVideoList (videoPagination: ComponentPagination): Observable> { const pagination = this.restService.componentPaginationToRestPagination(videoPagination) // prioritize first created since waiting longest @@ -48,9 +48,10 @@ export class VideoBlacklistService { return this.authHttp.get>(VideoBlacklistService.BASE_VIDEOS_URL + 'blacklist', { params }) .pipe( map(res => { - const videos = res.data.map(videoBlacklist => new Video(videoBlacklist.video)) - const totalVideos = res.total - return { videos, totalVideos } + return { + total: res.total, + data: res.data.map(videoBlacklist => new Video(videoBlacklist.video)) + } }), catchError(res => this.restExtractor.handleError(res)) ) diff --git a/client/src/app/shared/video/video-miniature.component.html b/client/src/app/shared/video/video-miniature.component.html index 51ca1393d..5d5691b75 100644 --- a/client/src/app/shared/video/video-miniature.component.html +++ b/client/src/app/shared/video/video-miniature.component.html @@ -31,7 +31,7 @@
{{ video.privacy.label }} - - + - {{ getStateLabel(video) }}
diff --git a/client/src/app/shared/video/video-miniature.component.ts b/client/src/app/shared/video/video-miniature.component.ts index 48475033c..d5c7dfd9b 100644 --- a/client/src/app/shared/video/video-miniature.component.ts +++ b/client/src/app/shared/video/video-miniature.component.ts @@ -95,6 +95,8 @@ export class VideoMiniatureComponent implements OnInit { } getStateLabel (video: Video) { + if (!video.state) return '' + if (video.privacy.id !== VideoPrivacy.PRIVATE && video.state.id === VideoState.PUBLISHED) { return this.i18n('Published') } -- cgit v1.2.3