Fix auto blacklist view

This commit is contained in:
Chocobozzz 2019-09-04 15:03:50 +02:00
parent f8278b9605
commit dedc7abb7b
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
4 changed files with 8 additions and 6 deletions

View File

@ -34,7 +34,7 @@ export class VideoBlacklistService {
)
}
getAutoBlacklistedAsVideoList (videoPagination: ComponentPagination): Observable<{ videos: Video[], totalVideos: number}> {
getAutoBlacklistedAsVideoList (videoPagination: ComponentPagination): Observable<ResultList<Video>> {
const pagination = this.restService.componentPaginationToRestPagination(videoPagination)
// prioritize first created since waiting longest
@ -48,9 +48,10 @@ export class VideoBlacklistService {
return this.authHttp.get<ResultList<VideoBlacklist>>(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))
)

View File

@ -31,7 +31,7 @@
<div class="video-info-privacy">
<ng-container *ngIf="displayOptions.privacyText">{{ video.privacy.label }}</ng-container>
<ng-container *ngIf="displayOptions.privacyText && getStateLabel(video)"> - </ng-container>
<ng-container *ngIf="displayOptions.privacyText && displayOptions.state && getStateLabel(video)"> - </ng-container>
<ng-container *ngIf="displayOptions.state">{{ getStateLabel(video) }}</ng-container>
</div>

View File

@ -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')
}

View File

@ -64,7 +64,6 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> {
const countQuery = buildBaseQuery()
const findQuery = buildBaseQuery()
findQuery.subQuery = false
findQuery.include = [
{
model: VideoModel,