1
0
Fork 0

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) const pagination = this.restService.componentPaginationToRestPagination(videoPagination)
// prioritize first created since waiting longest // 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 }) return this.authHttp.get<ResultList<VideoBlacklist>>(VideoBlacklistService.BASE_VIDEOS_URL + 'blacklist', { params })
.pipe( .pipe(
map(res => { map(res => {
const videos = res.data.map(videoBlacklist => new Video(videoBlacklist.video)) return {
const totalVideos = res.total total: res.total,
return { videos, totalVideos } data: res.data.map(videoBlacklist => new Video(videoBlacklist.video))
}
}), }),
catchError(res => this.restExtractor.handleError(res)) catchError(res => this.restExtractor.handleError(res))
) )

View file

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

View file

@ -95,6 +95,8 @@ export class VideoMiniatureComponent implements OnInit {
} }
getStateLabel (video: Video) { getStateLabel (video: Video) {
if (!video.state) return ''
if (video.privacy.id !== VideoPrivacy.PRIVATE && video.state.id === VideoState.PUBLISHED) { if (video.privacy.id !== VideoPrivacy.PRIVATE && video.state.id === VideoState.PUBLISHED) {
return this.i18n('Published') return this.i18n('Published')
} }

View file

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