From: Chocobozzz Date: Wed, 4 Sep 2019 13:03:50 +0000 (+0200) Subject: Fix auto blacklist view X-Git-Tag: v1.4.1~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=dedc7abb7beccb0b3a4a4fa4e8ccfef8ceecd5a6;p=oweals%2Fpeertube.git Fix auto blacklist view --- 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') } diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts index 22d949da0..18a1b8b4b 100644 --- a/server/models/video/video-blacklist.ts +++ b/server/models/video/video-blacklist.ts @@ -64,7 +64,6 @@ export class VideoBlacklistModel extends Model { const countQuery = buildBaseQuery() const findQuery = buildBaseQuery() - findQuery.subQuery = false findQuery.include = [ { model: VideoModel,