Update video categories and add fallback content for missing sections

Modify the video grid component to rename "GIPFELSTAMMTISCH" to "VOLKSMUSIK" and update filtering logic for "DIE Geschichte des Liedes" to "SCHLAGER & POP". Includes fallback mechanisms for empty category video lists.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 636b67ca-6f18-4eb7-b992-168c6c8b7078
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/60d372ff-2c10-46c7-b01b-10c3435136b0/636b67ca-6f18-4eb7-b992-168c6c8b7078/mNYBZ5G
This commit is contained in:
sebastjanartic 2025-09-06 20:03:59 +00:00
parent d27df48d11
commit ce6f34751a

View File

@ -64,14 +64,18 @@ export default function NetflixGrid({ videos, isLoading }: NetflixGridProps) {
title: "Meist Angesehen", title: "Meist Angesehen",
videos: sortedByViews.slice(0, 10) videos: sortedByViews.slice(0, 10)
}, },
...(folxStadlVideos.length > 0 ? [{ {
title: "FOLX STADL", title: "FOLX STADL",
videos: (() => { videos: (() => {
// If no specific FOLX STADL videos found, show some recent videos as placeholder
if (folxStadlVideos.length === 0) {
return sortedByDate.slice(0, 10);
}
// Shuffle FOLX STADL videos randomly // Shuffle FOLX STADL videos randomly
const shuffled = [...folxStadlVideos].sort(() => Math.random() - 0.5); const shuffled = [...folxStadlVideos].sort(() => Math.random() - 0.5);
return shuffled.slice(0, 10); return shuffled.slice(0, 10);
})() })()
}] : []), },
{ {
title: "VIDEO", title: "VIDEO",
videos: (() => { videos: (() => {
@ -103,54 +107,55 @@ export default function NetflixGrid({ videos, isLoading }: NetflixGridProps) {
})() })()
}, },
{ {
title: "GIPFELSTAMMTISCH", title: "VOLKSMUSIK",
videos: (() => { videos: (() => {
// Filter videos that contain "Gipfelstammtisch" in various forms // Filter videos by popular Volksmusik artists
const gipfelVideos = videos.filter(video => { const volksmusikVideos = videos.filter(video => {
const title = video.title.toLowerCase(); const title = video.title.toLowerCase();
return title.includes("gipfelstammtisch") || return title.includes("die alpentaler") ||
title.includes("gipfel stammtisch") || title.includes("die ladiner") ||
title.includes("gipfel-stammtisch"); title.includes("kastelruther spatzen") ||
title.includes("zillertaler") ||
title.includes("ursprung buam") ||
title.includes("tiroler") ||
title.includes("kärntner") ||
title.includes("steirer");
}); });
// Shuffle the Gipfelstammtisch videos randomly // If no specific volksmusik videos found, use fallback
const shuffled = [...gipfelVideos].sort(() => Math.random() - 0.5); if (volksmusikVideos.length === 0) {
return sortedByDate.slice(10, 20);
}
// Return 10 random videos from the GIPFELSTAMMTISCH collection const shuffled = [...volksmusikVideos].sort(() => Math.random() - 0.5);
return shuffled.slice(0, 10); return shuffled.slice(0, 10);
})() })()
}, },
{ {
title: "DIE Geschichte des Liedes", title: "SCHLAGER & POP",
videos: (() => { videos: (() => {
// Filter videos that contain "Geschichte des Liedes" in various forms // Filter videos that might be schlager or pop
const gdlVideos = videos.filter(video => { const schlagerVideos = videos.filter(video => {
const title = video.title.toLowerCase(); const title = video.title.toLowerCase();
const desc = video.description?.toLowerCase() || ""; return title.includes("band") ||
return title.includes("geschichte des liedes") || title.includes("duo") ||
title.includes("gschichte des liedes") || title.includes("sänger") ||
title.includes("die geschichte des liedes") || title.includes("musik") ||
desc.includes("geschichte des liedes") || title.includes("hit");
desc.includes("gschichte des liedes");
}); });
// If no specific "Geschichte des Liedes" videos found, fallback to general filter // If no specific schlager videos found, show different range
if (gdlVideos.length === 0) { if (schlagerVideos.length === 0) {
const fallbackVideos = videos.filter(video => return sortedByDate.slice(20, 30);
!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 = [...schlagerVideos].sort(() => Math.random() - 0.5);
const shuffled = [...gdlVideos].sort(() => Math.random() - 0.5);
// Return 10 random videos from the collection
return shuffled.slice(0, 10); return shuffled.slice(0, 10);
})() })()
},
{
title: "NEUE VIDEOS",
videos: sortedByDate.slice(0, 10)
} }
]; ];
}, [videos]); }, [videos]);