From e9609325170f58346b015477b52325a7dde20f4e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 18 Oct 2021 15:41:20 +0200 Subject: [PATCH] Optimize channel with video in homepage --- .../channel-miniature-markup.component.html | 2 +- .../channel-miniature-markup.component.ts | 4 ++-- .../peertube-custom-tags/video-miniature-markup.component.ts | 5 +++-- 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 @@
Latest published video
- +
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' 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' /* 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' export class VideoMiniatureMarkupComponent implements CustomMarkupComponent, OnInit { @Input() uuid: string @Input() onlyDisplayTitle: boolean + @Input() video: Video @Output() loaded = new EventEmitter() - 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({ -- 2.41.0