From 06d3e4089092e8293cf478af6652155b292f5d18 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Tue, 2 Sep 2025 17:00:04 +0000 Subject: [PATCH] Improve collection filtering to show specific content more accurately Update the Netflix grid component to correctly filter and display videos belonging to the "Geschichte des Liedes" collection by including title and description matches, with a fallback to general filtering if specific videos are not found. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1/4DOsXkx --- client/src/components/netflix-grid.tsx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index 6b5e53b..f125fbf 100644 --- a/client/src/components/netflix-grid.tsx +++ b/client/src/components/netflix-grid.tsx @@ -107,17 +107,27 @@ export default function NetflixGrid({ videos, isLoading }: NetflixGridProps) { { title: "Geschichte des Liedes", videos: (() => { - // Filter videos for Geschichte des Liedes (exclude FOLX STADL and Gipfelstammtisch) + // Filter videos that specifically contain "Geschichte des Liedes" in title or description const gdlVideos = videos.filter(video => - !video.title.includes("FOLX STADL") && - !video.title.includes("FOLXSTADL") && - !video.title.includes("Gipfelstammtisch") + video.title.toLowerCase().includes("geschichte des liedes") || + video.description?.toLowerCase().includes("geschichte des liedes") ); - // Shuffle the videos randomly + // If no specific "Geschichte des Liedes" videos found, fallback to general filter + if (gdlVideos.length === 0) { + const fallbackVideos = videos.filter(video => + !video.title.includes("FOLX STADL") && + !video.title.includes("FOLXSTADL") && + !video.title.includes("Gipfelstammtisch") + ); + const shuffled = [...fallbackVideos].sort(() => Math.random() - 0.5); + return shuffled.slice(0, 10); + } + + // Shuffle the Geschichte des Liedes videos randomly const shuffled = [...gdlVideos].sort(() => Math.random() - 0.5); - // Return 10 random videos + // Return 10 random videos from the collection return shuffled.slice(0, 10); })() }