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:
parent
e31fea7749
commit
3f71718379
1 changed files with 9 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue