Improve video recommendations and filtering logic for better content discovery
Update `VideoPage.tsx` to correctly filter recommended videos by excluding the current video's ID. Enhance category-based video filtering by using a temporary variable for the video title and safely accessing its properties. 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/HCAS0JG
This commit is contained in:
parent
dc20d4a07a
commit
46a4abd430
BIN
attached_assets/image_1756898012472.png
Normal file
BIN
attached_assets/image_1756898012472.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
@ -76,7 +76,7 @@ export default function VideoPage() {
|
||||
enabled: !!videoId,
|
||||
});
|
||||
|
||||
const recommendedVideos = recommendedResponse?.videos?.filter(v => v.id !== videoId) || [];
|
||||
const recommendedVideos = recommendedResponse?.videos?.filter(v => v.id !== currentVideo?.id) || [];
|
||||
|
||||
// Filter videos based on current video category for navigation
|
||||
const getFilteredVideosForNavigation = () => {
|
||||
@ -85,25 +85,27 @@ export default function VideoPage() {
|
||||
|
||||
|
||||
// Check if current video belongs to a specific category
|
||||
if (currentVideo.title.includes("FOLX STADL") || currentVideo.title.includes("FOLXSTADL")) {
|
||||
const videoTitle = currentVideo.title || '';
|
||||
|
||||
if (videoTitle.includes("FOLX STADL") || videoTitle.includes("FOLXSTADL")) {
|
||||
return allVideos.filter(video =>
|
||||
video.title.includes("FOLX STADL") || video.title.includes("FOLXSTADL")
|
||||
video.title?.includes("FOLX STADL") || video.title?.includes("FOLXSTADL")
|
||||
);
|
||||
}
|
||||
|
||||
if (currentVideo.title.includes("Gipfelstammtisch") ||
|
||||
currentVideo.title.includes("GIPFELSTAMMTISCH") ||
|
||||
currentVideo.title.includes("Gipfel Stammtisch")) {
|
||||
if (videoTitle.includes("Gipfelstammtisch") ||
|
||||
videoTitle.includes("GIPFELSTAMMTISCH") ||
|
||||
videoTitle.includes("Gipfel Stammtisch")) {
|
||||
return allVideos.filter(video =>
|
||||
video.title.includes("Gipfelstammtisch") ||
|
||||
video.title.includes("GIPFELSTAMMTISCH") ||
|
||||
video.title.includes("Gipfel Stammtisch")
|
||||
video.title?.includes("Gipfelstammtisch") ||
|
||||
video.title?.includes("GIPFELSTAMMTISCH") ||
|
||||
video.title?.includes("Gipfel Stammtisch")
|
||||
);
|
||||
}
|
||||
|
||||
if (currentVideo.title.includes("Geschichte des Liedes")) {
|
||||
if (videoTitle.includes("Geschichte des Liedes")) {
|
||||
const filtered = allVideos.filter(video =>
|
||||
video.title.includes("Geschichte des Liedes")
|
||||
video.title?.includes("Geschichte des Liedes")
|
||||
);
|
||||
return filtered;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user