mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-22 06:13:22 -07:00
perf(details): ⚡ Improve load performance for the TV and Movie Details pages
This commit is contained in:
parent
5cbb2ca528
commit
ccebc723e0
4 changed files with 39 additions and 9 deletions
|
@ -292,7 +292,12 @@
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<mat-card class="mat-elevation-z8 spacing-below">
|
<mat-card class="mat-elevation-z8 spacing-below">
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
|
@defer (on viewport; prefetch on idle) {
|
||||||
{{ movie.overview }}
|
{{ movie.overview }}
|
||||||
|
}
|
||||||
|
@placeholder {
|
||||||
|
<p-skeleton height="2rem" styleClass="mb-2"></p-skeleton>
|
||||||
|
}
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
|
@ -300,13 +305,23 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
@defer (on viewport; prefetch on idle) {
|
||||||
<cast-carousel [cast]="movie.credits.cast"></cast-carousel>
|
<cast-carousel [cast]="movie.credits.cast"></cast-carousel>
|
||||||
|
}
|
||||||
|
@placeholder {
|
||||||
|
<p-skeleton height="2rem" styleClass="mb-2"></p-skeleton>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<crew-carousel [crew]="movie.credits.crew"></crew-carousel>
|
@defer (on viewport; prefetch on idle) {
|
||||||
|
<cast-carousel [cast]="movie.credits.crew"></cast-carousel>
|
||||||
|
}
|
||||||
|
@placeholder {
|
||||||
|
<p-skeleton height="2rem" styleClass="mb-2"></p-skeleton>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -320,6 +335,7 @@
|
||||||
<div class="row" *ngIf="movie.videos?.results?.length > 0">
|
<div class="row" *ngIf="movie.videos?.results?.length > 0">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<mat-card class="mat-elevation-z8">
|
<mat-card class="mat-elevation-z8">
|
||||||
|
@defer (on viewport; prefetch on idle) {
|
||||||
<mat-card-header>{{ 'MediaDetails.Trailers' | translate }}</mat-card-header>
|
<mat-card-header>{{ 'MediaDetails.Trailers' | translate }}</mat-card-header>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<p-carousel class="no-indicator" [numVisible]="2" [numScroll]="10" [page]="0" [value]="movie.videos?.results">
|
<p-carousel class="no-indicator" [numVisible]="2" [numScroll]="10" [page]="0" [value]="movie.videos?.results">
|
||||||
|
@ -335,6 +351,10 @@
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</p-carousel>
|
</p-carousel>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
}
|
||||||
|
@placeholder {
|
||||||
|
<p-skeleton height="2rem" styleClass="mb-2"></p-skeleton>
|
||||||
|
}
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -345,6 +365,7 @@
|
||||||
<issues-panel [providerId]="movie.imdbId" [isAdmin]="isAdmin"></issues-panel>
|
<issues-panel [providerId]="movie.imdbId" [isAdmin]="isAdmin"></issues-panel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@defer (on viewport; prefetch on idle) {
|
||||||
<mat-accordion class="mat-elevation-z8 spacing-below">
|
<mat-accordion class="mat-elevation-z8 spacing-below">
|
||||||
<mat-expansion-panel *ngIf="movie.recommendations?.results?.length > 0">
|
<mat-expansion-panel *ngIf="movie.recommendations?.results?.length > 0">
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
|
@ -398,6 +419,10 @@
|
||||||
</div>
|
</div>
|
||||||
</mat-expansion-panel>
|
</mat-expansion-panel>
|
||||||
</mat-accordion>
|
</mat-accordion>
|
||||||
|
}
|
||||||
|
@placeholder {
|
||||||
|
<p-skeleton height="2rem" styleClass="mb-2"></p-skeleton>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -192,12 +192,10 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 col-md-10">
|
<div class="col-12 col-md-10">
|
||||||
@defer {
|
@defer (on viewport; prefetch on idle) {
|
||||||
<tv-request-grid id="requests-grid" [tvRequest]="tvRequest" [isAdmin]="isAdmin" [tv]="tv"></tv-request-grid>
|
<tv-request-grid id="requests-grid" [tvRequest]="tvRequest" [isAdmin]="isAdmin" [tv]="tv"></tv-request-grid>
|
||||||
} @placeholder {
|
} @placeholder {
|
||||||
<div class="loading-spinner">
|
<p-skeleton height="2rem" styleClass="mb-2"></p-skeleton>
|
||||||
<mat-spinner [color]="'accent'"></mat-spinner>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -216,14 +214,14 @@
|
||||||
</mat-panel-title>
|
</mat-panel-title>
|
||||||
</mat-expansion-panel-header>
|
</mat-expansion-panel-header>
|
||||||
|
|
||||||
@defer (on viewport) {
|
@defer (on viewport; prefetch on idle) {
|
||||||
<tv-requests-panel
|
<tv-requests-panel
|
||||||
[tvRequest]="tvRequest"
|
[tvRequest]="tvRequest"
|
||||||
[isAdmin]="isAdmin"
|
[isAdmin]="isAdmin"
|
||||||
[manageOwnRequests]="manageOwnRequests"
|
[manageOwnRequests]="manageOwnRequests"
|
||||||
></tv-requests-panel>
|
></tv-requests-panel>
|
||||||
} @placeholder {
|
} @placeholder {
|
||||||
<div class="loading-spinner">
|
<div class="loading-spinner" style="left: 50%;position: absolute;">
|
||||||
<mat-spinner [color]="'accent'"></mat-spinner>
|
<mat-spinner [color]="'accent'"></mat-spinner>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
@ -362,3 +362,8 @@
|
||||||
width:100%;
|
width:100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.placeholder {
|
||||||
|
height: 100px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { AuthGuard } from "../auth/auth.guard";
|
||||||
import { ArtistDetailsComponent } from "./components/artist/artist-details.component";
|
import { ArtistDetailsComponent } from "./components/artist/artist-details.component";
|
||||||
import { ReactiveFormsModule } from "@angular/forms";
|
import { ReactiveFormsModule } from "@angular/forms";
|
||||||
import { ImageComponent } from "app/components";
|
import { ImageComponent } from "app/components";
|
||||||
|
import { SkeletonModule } from "primeng/skeleton";
|
||||||
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
|
@ -29,6 +30,7 @@ const routes: Routes = [
|
||||||
PipeModule,
|
PipeModule,
|
||||||
CarouselModule,
|
CarouselModule,
|
||||||
ImageComponent,
|
ImageComponent,
|
||||||
|
SkeletonModule,
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
...fromComponents.components
|
...fromComponents.components
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue