Optimize channel with video in homepage

pull/4468/head
Chocobozzz 2021-10-18 15:41:20 +02:00
parent 2cc276f92f
commit e960932517
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 6 additions and 5 deletions

View File

@ -23,6 +23,6 @@
<div class="video" *ngIf="video && displayLatestVideo">
<div i18n class="video-label">Latest published video</div>
<my-video-miniature-markup [uuid]="video.uuid" [onlyDisplayTitle]="true"></my-video-miniature-markup>
<my-video-miniature-markup [video]="video" [onlyDisplayTitle]="true"></my-video-miniature-markup>
</div>
</div>

View File

@ -3,8 +3,8 @@ import { finalize, map, switchMap, tap } from 'rxjs/operators'
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
import { MarkdownService, Notifier, UserService } from '@app/core'
import { FindInBulkService } from '@app/shared/shared-search'
import { Video, VideoSortField } from '@shared/models/videos'
import { VideoChannel, VideoService } from '../../shared-main'
import { VideoSortField } from '@shared/models'
import { Video, VideoChannel, VideoService } from '../../shared-main'
import { CustomMarkupComponent } from './shared'
/*

View File

@ -18,11 +18,10 @@ import { CustomMarkupComponent } from './shared'
export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnInit {
@Input() uuid: string
@Input() onlyDisplayTitle: boolean
@Input() video: Video
@Output() loaded = new EventEmitter<boolean>()
video: Video
displayOptions: MiniatureDisplayOptions = {
date: true,
views: true,
@ -51,6 +50,8 @@ export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnI
}
}
if (this.video) return
this.findInBulk.getVideo(this.uuid)
.pipe(finalize(() => this.loaded.emit(true)))
.subscribe({