aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-18 15:41:20 +0200
committerChocobozzz <me@florianbigard.com>2021-10-18 15:41:20 +0200
commite9609325170f58346b015477b52325a7dde20f4e (patch)
treedf28fc4a398e03cb01c9974b757822813f56c4c5
parent2cc276f92fefeff88fcc74217e1174a3ddb3f074 (diff)
downloadPeerTube-e9609325170f58346b015477b52325a7dde20f4e.tar.gz
PeerTube-e9609325170f58346b015477b52325a7dde20f4e.tar.zst
PeerTube-e9609325170f58346b015477b52325a7dde20f4e.zip
Optimize channel with video in homepage
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.html2
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts4
-rw-r--r--client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts5
3 files changed, 6 insertions, 5 deletions
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.html b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.html
index 2efc56ab2..de150aac9 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.html
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.html
@@ -23,6 +23,6 @@
23 <div class="video" *ngIf="video && displayLatestVideo"> 23 <div class="video" *ngIf="video && displayLatestVideo">
24 <div i18n class="video-label">Latest published video</div> 24 <div i18n class="video-label">Latest published video</div>
25 25
26 <my-video-miniature-markup [uuid]="video.uuid" [onlyDisplayTitle]="true"></my-video-miniature-markup> 26 <my-video-miniature-markup [video]="video" [onlyDisplayTitle]="true"></my-video-miniature-markup>
27 </div> 27 </div>
28</div> 28</div>
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts
index 35b413b60..e9c466a90 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/channel-miniature-markup.component.ts
@@ -3,8 +3,8 @@ import { finalize, map, switchMap, tap } from 'rxjs/operators'
3import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' 3import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
4import { MarkdownService, Notifier, UserService } from '@app/core' 4import { MarkdownService, Notifier, UserService } from '@app/core'
5import { FindInBulkService } from '@app/shared/shared-search' 5import { FindInBulkService } from '@app/shared/shared-search'
6import { Video, VideoSortField } from '@shared/models/videos' 6import { VideoSortField } from '@shared/models'
7import { VideoChannel, VideoService } from '../../shared-main' 7import { Video, VideoChannel, VideoService } from '../../shared-main'
8import { CustomMarkupComponent } from './shared' 8import { CustomMarkupComponent } from './shared'
9 9
10/* 10/*
diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts
index 7315126e0..cbbacf77c 100644
--- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts
+++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/video-miniature-markup.component.ts
@@ -18,11 +18,10 @@ import { CustomMarkupComponent } from './shared'
18export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnInit { 18export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnInit {
19 @Input() uuid: string 19 @Input() uuid: string
20 @Input() onlyDisplayTitle: boolean 20 @Input() onlyDisplayTitle: boolean
21 @Input() video: Video
21 22
22 @Output() loaded = new EventEmitter<boolean>() 23 @Output() loaded = new EventEmitter<boolean>()
23 24
24 video: Video
25
26 displayOptions: MiniatureDisplayOptions = { 25 displayOptions: MiniatureDisplayOptions = {
27 date: true, 26 date: true,
28 views: true, 27 views: true,
@@ -51,6 +50,8 @@ export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnI
51 } 50 }
52 } 51 }
53 52
53 if (this.video) return
54
54 this.findInBulk.getVideo(this.uuid) 55 this.findInBulk.getVideo(this.uuid)
55 .pipe(finalize(() => this.loaded.emit(true))) 56 .pipe(finalize(() => this.loaded.emit(true)))
56 .subscribe({ 57 .subscribe({