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
This commit is contained in:
parent
ce3f1d59d3
commit
06d3e40890
@ -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);
|
||||
})()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user