Restored to 'e1314807be287b395cffa7ada2c736a4a7831e11'

Replit-Restored-To: e1314807be
This commit is contained in:
sebastjanartic
2025-09-06 20:11:43 +00:00
parent e4c0b8e5ad
commit e0a31bba5c
5 changed files with 56 additions and 78 deletions
+5 -18
View File
@@ -19,26 +19,13 @@ export default function AdSenseAd({
useEffect(() => {
try {
// Only initialize if the ad container has proper dimensions
if (typeof window !== 'undefined' && adRef.current) {
const adContainer = adRef.current;
const rect = adContainer.getBoundingClientRect();
// Wait for proper dimensions before initializing
if (rect.width > 0 && rect.height > 0) {
// Small delay to ensure DOM is fully ready
setTimeout(() => {
try {
// @ts-ignore
(window.adsbygoogle = window.adsbygoogle || []).push({});
} catch (error) {
console.warn('AdSense initialization skipped:', error);
}
}, 100);
}
// Ensure adsbygoogle is loaded
if (typeof window !== 'undefined') {
// @ts-ignore
(window.adsbygoogle = window.adsbygoogle || []).push({});
}
} catch (error) {
console.warn('AdSense initialization error:', error);
console.error('AdSense initialization error:', error);
}
}, []);
+40 -44
View File
@@ -49,35 +49,24 @@ export default function NetflixGrid({ videos, isLoading }: NetflixGridProps) {
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
);
// FOLX STADL videos - match the actual show format
const folxStadlVideos = videos.filter(video => {
const title = video.title.toLowerCase();
return title.includes("folx stadl s4") ||
title.includes("folx stadl s3") ||
title.includes("folx stadl s2") ||
title.includes("folx stadl s1") ||
title.includes("folx stadl") ||
title.includes("folxstadl");
});
// FOLX STADL videos
const folxStadlVideos = videos.filter(video =>
video.title.includes("FOLX STADL") || video.title.includes("FOLXSTADL")
);
return [
{
title: "Meist Angesehen",
videos: sortedByViews.slice(0, 10)
},
{
...(folxStadlVideos.length > 0 ? [{
title: "FOLX STADL",
videos: (() => {
// Show FOLX STADL episodes in order (newest first)
const sortedFolxStadl = [...folxStadlVideos].sort((a, b) => {
// Extract episode numbers for proper sorting
const aEp = parseInt(a.title.match(/\d+/)?.[0] || '0');
const bEp = parseInt(b.title.match(/\d+/)?.[0] || '0');
return bEp - aEp; // Newest episodes first
});
return sortedFolxStadl.slice(0, 10);
// Shuffle FOLX STADL videos randomly
const shuffled = [...folxStadlVideos].sort(() => Math.random() - 0.5);
return shuffled.slice(0, 10);
})()
},
}] : []),
{
title: "VIDEO",
videos: (() => {
@@ -111,37 +100,44 @@ export default function NetflixGrid({ videos, isLoading }: NetflixGridProps) {
{
title: "GIPFELSTAMMTISCH",
videos: (() => {
// Filter actual Gipfelstammtisch show episodes
const gipfelVideos = videos.filter(video => {
const title = video.title.toLowerCase();
return title.includes("gipfelstammtisch") &&
!title.includes("folx stadl"); // Exclude if it's part of Folx Stadl
});
// Filter videos that specifically contain "Gipfelstammtisch" in title
const gipfelVideos = videos.filter(video =>
video.title.includes("Gipfelstammtisch")
);
// Shuffle the Gipfelstammtisch videos
// Shuffle the Gipfelstammtisch videos randomly
const shuffled = [...gipfelVideos].sort(() => Math.random() - 0.5);
return shuffled.slice(0, 10);
})()
},
{
title: "DIE GESCHICHTE DES LIEDES",
videos: (() => {
// Filter actual "Die Geschichte des Liedes" episodes
const gdlVideos = videos.filter(video => {
const title = video.title.toLowerCase();
return title.includes("die geschichte des liedes") &&
!title.includes("folx stadl") &&
!title.includes("gipfelstammtisch");
});
// Shuffle the Geschichte des Liedes videos
const shuffled = [...gdlVideos].sort(() => Math.random() - 0.5);
// Return 10 random videos from the GIPFELSTAMMTISCH collection
return shuffled.slice(0, 10);
})()
},
{
title: "NEUE VIDEOS",
videos: sortedByDate.slice(0, 10)
title: "DIE Geschichte des Liedes",
videos: (() => {
// Filter videos that specifically contain "Geschichte des Liedes" in title or description
const gdlVideos = videos.filter(video =>
video.title.toLowerCase().includes("geschichte des liedes") ||
video.description?.toLowerCase().includes("geschichte des liedes")
);
// 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 from the collection
return shuffled.slice(0, 10);
})()
}
];
}, [videos]);
+4 -2
View File
@@ -80,8 +80,10 @@ function initApp() {
</div>
`;
// Remove auto-refresh to prevent loops
console.warn('Auto-refresh disabled to prevent reload loops');
// Auto-refresh on error
setTimeout(() => {
location.reload();
}, 3000);
}
}
}