diff --git a/.gitignore b/.gitignore index a690fca..e0da08e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules /dist -.env \ No newline at end of file +.env +/drizzle \ No newline at end of file diff --git a/drizzle.config.json b/drizzle.config.json new file mode 100644 index 0000000..d07215d --- /dev/null +++ b/drizzle.config.json @@ -0,0 +1,5 @@ +{ + "dialect": "postgresql", + "schema": "./src/models/*", + "out": "./drizzle" +} diff --git a/src/services/xvideosService.ts b/src/services/xvideosService.ts index 9c6aea1..b9a87f7 100644 --- a/src/services/xvideosService.ts +++ b/src/services/xvideosService.ts @@ -12,8 +12,7 @@ export const getRandomVideo = async ( const lastPage = pagination.pages[pagination.pages.length - 1]; const page = Math.floor(Math.random() * lastPage) + 1; const { videos } = await xvideos.videos.search({ k, page }); - const randomVideo = videos[Math.floor(Math.random() * videos.length)]; - const { url, title, duration } = randomVideo; + const { url, title, duration } = videos[Math.floor(Math.random() * videos.length)]; return { url, title, duration, k }; } catch (error) { console.error("Error getting random video", error);