pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hide recommended if there is no progress

Pas 2b968031 49beea82

+31 -18
+31 -18
src/pages/discover/discoverContent.tsx
··· 4 4 import { DetailsModal } from "@/components/overlays/details/DetailsModal"; 5 5 import { useModal } from "@/components/overlays/Modal"; 6 6 import { useDiscoverStore } from "@/stores/discover"; 7 + import { useProgressStore } from "@/stores/progress"; 7 8 import { MediaItem } from "@/utils/mediaTypes"; 8 9 9 10 import { DiscoverNavigation } from "./components/DiscoverNavigation"; ··· 17 18 const [detailsData, setDetailsData] = useState<any>(); 18 19 const detailsModal = useModal("discover-details"); 19 20 const carouselRefs = useRef<{ [key: string]: HTMLDivElement | null }>({}); 21 + const progressItems = useProgressStore((state) => state.items); 20 22 21 23 // Only load data for the active tab 22 24 const isMoviesTab = selectedCategory === "movies"; ··· 35 37 detailsModal.show(); 36 38 }; 37 39 40 + const movieProgressItems = Object.entries(progressItems || {}).filter( 41 + ([_, item]) => item.type === "movie", 42 + ); 43 + const tvProgressItems = Object.entries(progressItems || {}).filter( 44 + ([_, item]) => item.type === "show", 45 + ); 46 + 38 47 // Render Movies content with lazy loading 39 48 const renderMoviesContent = () => { 40 49 return ( 41 50 <> 42 - {/* Movie Recommendations */} 43 - <MediaCarousel 44 - content={{ type: "recommendations" }} 45 - isTVShow={false} 46 - carouselRefs={carouselRefs} 47 - onShowDetails={handleShowDetails} 48 - moreContent 49 - showRecommendations 50 - /> 51 + {/* Movie Recommendations - only show if there are movie progress items */} 52 + {movieProgressItems.length > 0 && ( 53 + <MediaCarousel 54 + content={{ type: "recommendations" }} 55 + isTVShow={false} 56 + carouselRefs={carouselRefs} 57 + onShowDetails={handleShowDetails} 58 + moreContent 59 + showRecommendations 60 + /> 61 + )} 51 62 52 63 {/* Latest Releases */} 53 64 <MediaCarousel ··· 103 114 const renderTVShowsContent = () => { 104 115 return ( 105 116 <> 106 - {/* TV Show Recommendations */} 107 - <MediaCarousel 108 - content={{ type: "recommendations" }} 109 - isTVShow 110 - carouselRefs={carouselRefs} 111 - onShowDetails={handleShowDetails} 112 - moreContent 113 - showRecommendations 114 - /> 117 + {/* TV Show Recommendations - only show if there are TV show progress items */} 118 + {tvProgressItems.length > 0 && ( 119 + <MediaCarousel 120 + content={{ type: "recommendations" }} 121 + isTVShow 122 + carouselRefs={carouselRefs} 123 + onShowDetails={handleShowDetails} 124 + moreContent 125 + showRecommendations 126 + /> 127 + )} 115 128 116 129 {/* On Air */} 117 130 <MediaCarousel