Fix auto blacklist view
This commit is contained in:
parent
f8278b9605
commit
dedc7abb7b
4 changed files with 8 additions and 6 deletions
|
@ -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))
|
||||
)
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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')
|
||||
}
|
||||
|
|
|
@ -64,7 +64,6 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> {
|
|||
const countQuery = buildBaseQuery()
|
||||
|
||||
const findQuery = buildBaseQuery()
|
||||
findQuery.subQuery = false
|
||||
findQuery.include = [
|
||||
{
|
||||
model: VideoModel,
|
||||
|
|
Loading…
Reference in a new issue