mirror of
https://github.com/p-stream/p-stream.git
synced 2026-04-21 09:52:16 +00:00
remove duplicates on more content page
This commit is contained in:
parent
49e1423a0e
commit
a128a2cb19
1 changed files with 9 additions and 10 deletions
|
|
@ -57,6 +57,12 @@ export function MoreContent({ onShowDetails }: MoreContentProps) {
|
||||||
title: item.title || "",
|
title: item.title || "",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// Find selected recommendation source (used in multiple places)
|
||||||
|
const selectedRecommendationSource = React.useMemo(
|
||||||
|
() => recommendationSources.find((s) => s.id === selectedRecommendationId),
|
||||||
|
[recommendationSources, selectedRecommendationId],
|
||||||
|
);
|
||||||
|
|
||||||
// Determine the actual content type and ID from URL parameters
|
// Determine the actual content type and ID from URL parameters
|
||||||
const actualContentType = contentType || category?.split("-")[0] || "popular";
|
const actualContentType = contentType || category?.split("-")[0] || "popular";
|
||||||
const actualMediaType =
|
const actualMediaType =
|
||||||
|
|
@ -79,9 +85,7 @@ export function MoreContent({ onShowDetails }: MoreContentProps) {
|
||||||
page: currentPage,
|
page: currentPage,
|
||||||
genreName: selectedGenre?.name,
|
genreName: selectedGenre?.name,
|
||||||
providerName: selectedProvider?.name,
|
providerName: selectedProvider?.name,
|
||||||
mediaTitle: recommendationSources.find(
|
mediaTitle: selectedRecommendationSource?.title,
|
||||||
(s) => s.id === selectedRecommendationId,
|
|
||||||
)?.title,
|
|
||||||
isCarouselView: false,
|
isCarouselView: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -218,15 +222,10 @@ export function MoreContent({ onShowDetails }: MoreContentProps) {
|
||||||
<div className="relative pr-4">
|
<div className="relative pr-4">
|
||||||
<Dropdown
|
<Dropdown
|
||||||
selectedItem={
|
selectedItem={
|
||||||
recommendationSources.find(
|
selectedRecommendationSource
|
||||||
(s) => s.id === selectedRecommendationId,
|
|
||||||
)
|
|
||||||
? {
|
? {
|
||||||
id: selectedRecommendationId,
|
id: selectedRecommendationId,
|
||||||
name:
|
name: selectedRecommendationSource?.title || "",
|
||||||
recommendationSources.find(
|
|
||||||
(s) => s.id === selectedRecommendationId,
|
|
||||||
)?.title || "",
|
|
||||||
}
|
}
|
||||||
: { id: "", name: "..." }
|
: { id: "", name: "..." }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue