Explorar o código

[Phase 5 U1] Randomize page on landing Random Roll

Landing-page Roll the Dice always hit /api/tmdb/popular page 1
(server-side cached 5min), so it returned the same ~20 movies.
Pick a random page 1-50 each click to widen the pool to ~1000.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
User hai 2 meses
pai
achega
451179ff7f
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/components/landing/carousel-animation.tsx

+ 4 - 1
src/components/landing/carousel-animation.tsx

@@ -180,7 +180,10 @@ export function CarouselSection() {
     }
   };
 
-  const handleRandomRoll = () => fetchAndRoll("/api/tmdb/popular");
+  const handleRandomRoll = () => {
+    const page = Math.floor(Math.random() * 50) + 1;
+    return fetchAndRoll(`/api/tmdb/popular?page=${page}`);
+  };
 
   const handleGenreRoll = ({ genreIds, moodKeys }: { genreIds: number[]; moodKeys: string[] }) => {
     setModalOpen(false);