1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

Fuck wit topflix #

This commit is contained in:
Cooper Ransom 2024-04-02 18:31:09 -04:00
parent e31fea7749
commit 3f71718379

View file

@ -314,7 +314,9 @@ export function TopFlix() {
allMovies.forEach((movie) => uniqueTitles.add(movie.title)); // Add each title to the Set
const uniqueTitlesArray = Array.from(uniqueTitles); // Convert the Set back to an array
const randomIndex = Math.floor(Math.random() * uniqueTitlesArray.length);
const selectedMovie = allMovies.find((movie) => movie.title === uniqueTitlesArray[randomIndex]);
const selectedMovie = allMovies.find(
(movie) => movie.title === uniqueTitlesArray[randomIndex],
);
if (selectedMovie) {
setRandomMovie(selectedMovie);
@ -323,7 +325,9 @@ export function TopFlix() {
// Schedule navigation after 5 seconds
setTimeout(() => {
navigate(`/media/tmdb-movie-${selectedMovie.id}-${selectedMovie.title}`);
navigate(
`/media/tmdb-movie-${selectedMovie.id}-${selectedMovie.title}`,
);
}, 5000);
}
};