From 56af6b7d8033ed5777155a590bb859c73f257ef4 Mon Sep 17 00:00:00 2001 From: OSint Date: Tue, 9 Jul 2024 23:54:45 -0500 Subject: [PATCH] drizzle config file --- .gitignore | 3 ++- drizzle.config.json | 5 +++++ src/services/xvideosService.ts | 3 +-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 drizzle.config.json 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);