diff --git a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html index a1b3bc81b..f8dbaf257 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html @@ -5,13 +5,17 @@ {{'Discovery.Tv' | translate}} -@defer (when discoverResults.length > 0) { +@defer (when discoverResults.length > 0; prefetch on idle) { } -@placeholder(minimum 500) { - +@placeholder(minimum 300) { +
+
+ +
+
} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss index 81c559a83..9b62c9256 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss @@ -105,6 +105,30 @@ padding: 5px; } +.loading-container { + display: flex; + gap: 10px; + padding: 0 20px; + margin-top: 20px; +} + +.loading-container .col-2 { + flex: 0 0 auto; + width: calc(10% - 9px); +} + +@media (max-width: 768px) { + .loading-container .col-2 { + width: calc(50% - 5px); + } +} + +@media (max-width: 480px) { + .loading-container .col-2 { + width: calc(100% - 0px); + } +} + @media (min-width:755px){ ::ng-deep .p-carousel-item{ flex: 1 0 200px !important; diff --git a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts index 36b8122ff..2463af3c4 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts @@ -43,7 +43,7 @@ export class CarouselListComponent implements OnInit { get mediaTypeStorageKey() { return "DiscoverOptions" + this.discoverType.toString(); }; - private amountToLoad = 17; + private amountToLoad = 10; private currentlyLoaded = 0; private baseUrl: string = ""; @@ -148,6 +148,7 @@ export class CarouselListComponent implements OnInit { } public async ngOnInit() { + this.is4kEnabled = this.featureFacade.is4kEnabled(); this.currentlyLoaded = 0; const localDiscoverOptions = +this.storageService.get(this.mediaTypeStorageKey); @@ -155,11 +156,15 @@ export class CarouselListComponent implements OnInit { this.discoverOptions = DiscoverOption[DiscoverOption[localDiscoverOptions]]; } - let currentIteration = 0; - while (this.discoverResults.length <= 14 && currentIteration <= 3) { - currentIteration++; + // Load initial data - just enough to fill the first carousel page + // This reduces initial API calls and improves loading performance + await this.loadData(false); + + // If we don't have enough results to fill the carousel, load one more batch + if (this.discoverResults.length < 10) { await this.loadData(false); } + } public async toggleChanged(event: MatButtonToggleChange) { diff --git a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html index 16a46c0d6..dc4e33be1 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html @@ -1,46 +1,108 @@
-
-

{{ 'Discovery.Genres' | translate }}

- -
-
-

{{ 'Discovery.RecentlyRequestedTab' | translate }}

-
- + @defer (on viewport; prefetch on idle) { +
+

{{ 'Discovery.Genres' | translate }}

+
-
- - -
-

{{ 'Discovery.SeasonalTab' | translate }}

-
- + } @placeholder(minimum 300) { +
+

{{ 'Discovery.Genres' | translate }}

+
-
+ } -
-

{{ 'Discovery.PopularTab' | translate }}

-
- + @defer (on viewport; prefetch on idle) { +
+

{{ 'Discovery.RecentlyRequestedTab' | translate }}

+
+ +
-
+ } @placeholder(minimum 300) { +
+

{{ 'Discovery.RecentlyRequestedTab' | translate }}

+
+
+ +
+
+
+ } -
-

{{ 'Discovery.TrendingTab' | translate }}

-
- + @defer (on viewport; prefetch on idle) { +
+

{{ 'Discovery.SeasonalTab' | translate }}

+
+ +
-
+ } @placeholder(minimum 300) { +
+

{{ 'Discovery.SeasonalTab' | translate }}

+
+
+ +
+
+
+ } -
-

{{ 'Discovery.UpcomingTab' | translate }}

-
- + @defer (on viewport; prefetch on idle) { +
+

{{ 'Discovery.PopularTab' | translate }}

+
+ +
-
+ } @placeholder(minimum 300) { +
+

{{ 'Discovery.PopularTab' | translate }}

+
+
+ +
+
+
+ } + + @defer (on viewport; prefetch on idle) { +
+

{{ 'Discovery.TrendingTab' | translate }}

+
+ +
+
+ } @placeholder(minimum 300) { +
+

{{ 'Discovery.TrendingTab' | translate }}

+
+
+ +
+
+
+ } + + @defer (on viewport; prefetch on idle) { +
+

{{ 'Discovery.UpcomingTab' | translate }}

+
+ +
+
+ } @placeholder(minimum 300) { +
+

{{ 'Discovery.UpcomingTab' | translate }}

+
+
+ +
+
+
+ }
diff --git a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss index d95586507..9ba892e01 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss @@ -9,4 +9,28 @@ h2{ margin-top:40px; margin-left:40px; font-size: 24px; +} + +.loading-container { + display: flex; + gap: 10px; + padding: 0 20px; + margin-top: 20px; +} + +.loading-container .col-2 { + flex: 0 0 auto; + width: calc(10% - 9px); +} + +@media (max-width: 768px) { + .loading-container .col-2 { + width: calc(50% - 5px); + } +} + +@media (max-width: 480px) { + .loading-container .col-2 { + width: calc(100% - 0px); + } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html index 6da28c744..a6db36865 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html @@ -1,4 +1,4 @@ -@defer (when requests()) { +@defer (when requests(); prefetch on idle) {
@@ -13,21 +13,9 @@
-}@placeholder(minimum 500) { +}@placeholder(minimum 300) {
-
- -
-
- -
-
- -
-
- -
-
+
diff --git a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.scss b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.scss index 01c68db4d..c7fef78f9 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.scss @@ -105,12 +105,32 @@ padding: 5px; } +.loading-container { + display: flex; + gap: 10px; + padding: 0 20px; + margin-top: 20px; +} + +.loading-container .col-2 { + flex: 0 0 auto; + width: calc(20% - 8px); +} + +@media (max-width: 768px) { + .loading-container .col-2 { + width: calc(50% - 5px); + } +} + +@media (max-width: 480px) { + .loading-container .col-2 { + width: calc(100% - 0px); + } +} + @media (min-width:755px){ ::ng-deep .p-carousel-item{ flex: 1 0 200px !important; } -} - -.loading-container { - margin-left: 10rem; } \ No newline at end of file