From c70d75c2d08e593729b405864dcedcf331306eef Mon Sep 17 00:00:00 2001 From: Ankit Varshney Date: Sun, 26 Nov 2023 22:21:27 +0530 Subject: [PATCH] changed chunk size --- controllers/video_controller.js | 2 +- models/user_model.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/controllers/video_controller.js b/controllers/video_controller.js index f287555..6de8f00 100644 --- a/controllers/video_controller.js +++ b/controllers/video_controller.js @@ -29,7 +29,7 @@ const videoCtrl = { } const videoPath = req.query.path; const videoSize = fs.statSync(videoPath).size; - const CHUNK_SIZE = 10 ** 6; + const CHUNK_SIZE = 10 ** 4; const start = Number(range.replace(/\D/g, "")); const end = Math.min(start + CHUNK_SIZE, videoSize - 1); const remainingTime = Math.floor( diff --git a/models/user_model.js b/models/user_model.js index 092287e..5e8b613 100644 --- a/models/user_model.js +++ b/models/user_model.js @@ -88,9 +88,10 @@ const userSchema = new mongoose.Schema({ is_certified_educator: { type: Boolean, default: false, - } + }, }); -userSchema.path("createdCourse").default([]); -userSchema.path("ownedCourse").default([]); +userSchema.path("createdCourse").default(() => []); +userSchema.path("ownedCourse").default(() => []); + const User = new mongoose.model("User", userSchema); module.exports = User;