mirror of https://github.com/Chocobozzz/PeerTube
Optimize channel with video in homepage
parent
2cc276f92f
commit
e960932517
|
@ -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>
|
||||
|
|
|
@ -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'
|
||||
|
||||
/*
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue