Skip to content

Commit

Permalink
drizzle config file
Browse files Browse the repository at this point in the history
  • Loading branch information
OSintt committed Jul 10, 2024
1 parent 99ec7a3 commit 56af6b7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
/dist
.env
.env
/drizzle
5 changes: 5 additions & 0 deletions drizzle.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dialect": "postgresql",
"schema": "./src/models/*",
"out": "./drizzle"
}
3 changes: 1 addition & 2 deletions src/services/xvideosService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 56af6b7

Please sign in to comment.