diff --git a/controllers/teacher_controller.js b/controllers/teacher_controller.js index 8dd58e3..efe4ccf 100644 --- a/controllers/teacher_controller.js +++ b/controllers/teacher_controller.js @@ -2,7 +2,8 @@ const { ErrorHandler } = require("../middlewares/error"); const { User, Course, Video, Category } = require("../models"); const { getVideoDurationInSeconds } = require("get-video-duration"); const fs = require("fs"); - +const Queue = require("bull"); +const videoConversionQueue = new Queue("videoConversion"); const path = require("path"); const { @@ -15,8 +16,8 @@ const { const createConversionWorker = require("../utils/videoConverter"); const resolutions = [ { name: "144p", width: 256, height: 144 }, - // { name: "360p", width: 640, height: 360 }, - // { name: "720p", width: 1280, height: 720 }, + { name: "360p", width: 640, height: 360 }, + { name: "720p", width: 1280, height: 720 }, ]; const teacherCtrl = { @@ -168,6 +169,7 @@ const teacherCtrl = { videoFilePath, inputFilePath, inputFileName; + let videoConversionQueue; try { const courseid = req.params.courseId; @@ -178,6 +180,7 @@ const teacherCtrl = { const videotitle = result2.videoTitle; const notesfile = req.files.notes; const videofile = req.files.video; + videoConversionQueue = new Queue("videoConversion"); let course = await Course.findById(courseId); if (notesfile) { @@ -208,64 +211,120 @@ const teacherCtrl = { fs.unlinkSync(videoFilePath); return next(new ErrorHandler(400, "You are not the creater of course")); } - // if (course.isPublished) { - // if (noteFilePath != null) { - // fs.unlinkSync(noteFilePath); - // } - // fs.unlinkSync(videoFilePath); - // return next(new ErrorHandler(400, "Course is already published")); - // } - - - //Video Conversion using worker threads - const conversionPromise = resolutions.map((resolution) => { - inputFilePath = videoFilePath; - inputFileName = path.basename( - inputFilePath, - path.extname(inputFilePath) - ); - const outputPath = `public/course_videos/${inputFileName}-${ - resolution.name - }${path.extname(inputFilePath)}`; - return createConversionWorker(resolution, inputFilePath, outputPath); - }); - await Promise.all(conversionPromise); - console.log("Video conversion completed"); - - //calculate video duration + // res.json({ + // success: true, + // message: "Video uploaded successfully", + // data: { + // duration: course.duration, + // }, + // }); + inputFilePath = videoFilePath; + inputFileName = path.basename(inputFilePath, path.extname(inputFilePath)); + const du = await getVideoDurationInSeconds(videoFilePath); - - let video = new Video({ - videoTitle: videotitle, - videoUrl: videoFilePath, - videoUrl_144p: `public/course_videos/${inputFileName}-144p${path.extname( - inputFilePath - )}`, - videoUrl_360p: `public/course_videos/${inputFileName}-360p${path.extname( - inputFilePath - )}`, - videoUrl_720p: `public/course_videos/${inputFileName}-720p${path.extname( - inputFilePath - )}`, - videoDuration: du, - }); - video = await video.save(); - course.videos.push({ - video: video._id, - note: noteFilePath, - }); course.duration += du; + await course.save(); + await videoConversionQueue.add({ + resolutions, + inputFilePath, + + videoFilePath, + videotitle, + inputFileName, + noteFilePath, + courseId, + du + }); + res.json({ + success: true, + message: "Video uploaded successfully", + data: { + duration: course.duration, + }, + }); + //Video Conversion using worker threads + // const conversionPromise = resolutions.map((resolution) => { + // inputFilePath = videoFilePath; + // inputFileName = path.basename( + // inputFilePath, + // path.extname(inputFilePath) + // ); + + // const outputPath = `public/course_videos/${inputFileName}-${ + // resolution.name + // }${path.extname(inputFilePath)}`; + // const conversionData = { + // resolution, + // inputFilePath, + // outputPath, + // }; + // return videoConversionQueue.add(conversionData); + // // return createConversionWorker(resolution, inputFilePath, outputPath); + // }); + // await Promise.all(conversionPromise); - course = await course.save(); - - res.json({ - success: true, - message: "Video uploaded successfully", - data: { - duration: course.duration, - }, + // console.log("Video conversion completed"); + videoConversionQueue.process(async (job) => { + const { + resolutions, + inputFilePath, + videoFilePath, + videotitle, + inputFileName, + noteFilePath, + courseId, + du + } = job.data; + console.log(`Processing video conversion for resolution`); + + const conversionPromise = resolutions.map((resolution) => { + const outputPath = `public/course_videos/${inputFileName}-${ + resolution.name + }${path.extname(inputFilePath)}`; + return createConversionWorker(resolution, inputFilePath, outputPath); + // return videoConversionQueue.add(conversionData); + // return createConversionWorker(resolution, inputFilePath, outputPath); + }); + await Promise.all(conversionPromise); + + console.log("Video conversion completed"); + + // await createConversionWorker(resolution, inputFilePath, outputPath); + // console.log( + // `Video conversion completed for resolution: ${resolution.name}` + // ); + + let video = new Video({ + videoTitle: videotitle, + videoUrl: videoFilePath, + videoUrl_144p: `public/course_videos/${inputFileName}-144p${path.extname( + inputFilePath + )}`, + videoUrl_360p: `public/course_videos/${inputFileName}-360p${path.extname( + inputFilePath + )}`, + videoUrl_720p: `public/course_videos/${inputFileName}-720p${path.extname( + inputFilePath + )}`, + videoDuration: du, + }); + video = await video.save(); + // console.log(video); + // console.log("Video saved successfully"); + const coursess=await Course.findById(courseId); + await coursess.videos.push({ + video: video._id, + note: noteFilePath, + }); + console.log(coursess); + // console.log("Video pushed to course"); + // coursess.duration += du; + // console.log("Duration updated"); + coursess = await coursess.save(); + // console.log("Video uploaded successfully"); }); + } catch (e) { if (noteFilePath) { fs.unlinkSync(noteFilePath); diff --git a/controllers/user_controller.js b/controllers/user_controller.js index 59cd144..e2c92fa 100644 --- a/controllers/user_controller.js +++ b/controllers/user_controller.js @@ -13,7 +13,9 @@ const userCtrl = { if (!req.file) return next(new ErrorHandler(400, "Please upload a file")); const user = req.user; if (user.profileimg != null) { - fs.unlinkSync("public" + "/" + user.profileimg); + if (fs.existsSync("public" + "/" + user.profileimg)) { + fs.unlinkSync("public" + "/" + user.profileimg); + } } user.profileimg = `thumbnail` + "/" + req.file.filename; await user.save(); @@ -36,7 +38,9 @@ const userCtrl = { user.profileimg = null; await user.save(); if (path != null) { - fs.unlinkSync("public" + "/" + path); + if (fs.exists("public" + "/" + path)) { + fs.unlinkSync("public" + "/" + path); + } } res.json({ success: true, diff --git a/index.js b/index.js index e4d3e9e..8b2fc6e 100644 --- a/index.js +++ b/index.js @@ -20,6 +20,7 @@ const http = require("http"); const server = http.createServer(app); const initializedSocket = require("./utils/socket"); +const { Course, Video, Category } = require("./models"); // const { Course, Video, Category } = require("./models"); app.use( @@ -55,6 +56,10 @@ initializedSocket(server); mongoose.connect(process.env.DB).then(() => { console.log("connection is successful"); server.listen(PORT, "0.0.0.0", () => { + // Category.deleteMany({}).then(() => { + // console.log("deleted all courses"); + // } + // ); console.log(`Server is running on port ${PORT}`); }); }); diff --git a/package-lock.json b/package-lock.json index 35b6298..1cfc2fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "bcrypt": "^5.1.1", "bcryptjs": "^2.4.3", "brace-expansion": "^1.1.11", + "bull": "^4.11.5", "chalk": "^4.1.2", "color-convert": "^2.0.1", "color-name": "^1.1.4", @@ -232,6 +233,11 @@ "@hapi/hoek": "^9.0.0" } }, + "node_modules/@ioredis/commands": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", + "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==" + }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", @@ -273,6 +279,78 @@ "sparse-bitfield": "^3.0.3" } }, + "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.2.tgz", + "integrity": "sha512-9bfjwDxIDWmmOKusUcqdS4Rw+SETlp9Dy39Xui9BEGEk19dDwH0jhipwFzEff/pFg95NKymc6TOTbRKcWeRqyQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.2.tgz", + "integrity": "sha512-lwriRAHm1Yg4iDf23Oxm9n/t5Zpw1lVnxYU3HnJPTi2lJRkKTrps1KVgvL6m7WvmhYVt/FIsssWay+k45QHeuw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.2.tgz", + "integrity": "sha512-MOI9Dlfrpi2Cuc7i5dXdxPbFIgbDBGgKR5F2yWEa6FVEtSWncfVNKW5AKjImAQ6CZlBK9tympdsZJ2xThBiWWA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.2.tgz", + "integrity": "sha512-FU20Bo66/f7He9Fp9sP2zaJ1Q8L9uLPZQDub/WlUip78JlPeMbVL8546HbZfcW9LNciEXc8d+tThSJjSC+tmsg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.2.tgz", + "integrity": "sha512-gsWNDCklNy7Ajk0vBBf9jEx04RUxuDQfBse918Ww+Qb9HCPoGzS+XJTLe96iN3BVK7grnLiYghP/M4L8VsaHeA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.2.tgz", + "integrity": "sha512-O+6Gs8UeDbyFpbSh2CPEz/UOrrdWPTBYNblZK5CxxLisYt4kGX3Sc+czffFonyjiGSq3jWLwJS/CCJc7tBr4sQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@redis/bloom": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", @@ -709,6 +787,31 @@ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, + "node_modules/bull": { + "version": "4.11.5", + "resolved": "https://registry.npmjs.org/bull/-/bull-4.11.5.tgz", + "integrity": "sha512-9jazyvBBYr55IRDkfJh/mJjWiq8NJUMoCC5zTuBX4JhkZvVXegnwsaIa1jr3x9xwSxGvWEhwQ9lt1jlCT5j6pQ==", + "dependencies": { + "cron-parser": "^4.2.1", + "get-port": "^5.1.1", + "ioredis": "^5.3.2", + "lodash": "^4.17.21", + "msgpackr": "^1.5.2", + "semver": "^7.5.2", + "uuid": "^8.3.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/bull/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -957,6 +1060,17 @@ "node": ">= 0.10" } }, + "node_modules/cron-parser": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.9.0.tgz", + "integrity": "sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==", + "dependencies": { + "luxon": "^3.2.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -1029,6 +1143,14 @@ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -1468,6 +1590,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-port": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", + "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -1716,6 +1849,50 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/ioredis": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", + "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", + "dependencies": { + "@ioredis/commands": "^1.1.1", + "cluster-key-slot": "^1.1.0", + "debug": "^4.3.4", + "denque": "^2.1.0", + "lodash.defaults": "^4.2.0", + "lodash.isarguments": "^3.1.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0", + "standard-as-callback": "^2.1.0" + }, + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ioredis" + } + }, + "node_modules/ioredis/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/ioredis/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/ip": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", @@ -1927,11 +2104,21 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==" + }, "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" }, + "node_modules/lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==" + }, "node_modules/lodash.isboolean": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", @@ -1973,6 +2160,14 @@ "node": ">=10" } }, + "node_modules/luxon": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", + "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", + "engines": { + "node": ">=12" + } + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -2250,6 +2445,35 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, + "node_modules/msgpackr": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.9.9.tgz", + "integrity": "sha512-sbn6mioS2w0lq1O6PpGtsv6Gy8roWM+o3o4Sqjd6DudrL/nOugY+KyJUimoWzHnf9OkO0T6broHFnYE/R05t9A==", + "optionalDependencies": { + "msgpackr-extract": "^3.0.2" + } + }, + "node_modules/msgpackr-extract": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.2.tgz", + "integrity": "sha512-SdzXp4kD/Qf8agZ9+iTu6eql0m3kWm1A2y1hkpTeVNENutaB0BwHlSvAIaMxwntmRUAUjon2V4L8Z/njd0Ct8A==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "node-gyp-build-optional-packages": "5.0.7" + }, + "bin": { + "download-msgpackr-prebuilds": "bin/download-prebuilds.js" + }, + "optionalDependencies": { + "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.2", + "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.2", + "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.2", + "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.2", + "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.2", + "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.2" + } + }, "node_modules/multer": { "version": "1.4.5-lts.1", "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", @@ -2334,6 +2558,17 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/node-gyp-build-optional-packages": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.7.tgz", + "integrity": "sha512-YlCCc6Wffkx0kHkmam79GKvDQ6x+QZkMjFGrIMxgFNILFvGSbCp2fCBC55pGTT9gVaz8Na5CLmxt/urtzRv36w==", + "optional": true, + "bin": { + "node-gyp-build-optional-packages": "bin.js", + "node-gyp-build-optional-packages-optional": "optional.js", + "node-gyp-build-optional-packages-test": "build-test.js" + } + }, "node_modules/nodemailer": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.7.tgz", @@ -2656,6 +2891,25 @@ "@redis/time-series": "1.0.5" } }, + "node_modules/redis-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", + "engines": { + "node": ">=4" + } + }, + "node_modules/redis-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", + "dependencies": { + "redis-errors": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -3045,6 +3299,11 @@ "node": ">=0.10.0" } }, + "node_modules/standard-as-callback": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==" + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", diff --git a/package.json b/package.json index 89267eb..3ff023e 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "bcrypt": "^5.1.1", "bcryptjs": "^2.4.3", "brace-expansion": "^1.1.11", + "bull": "^4.11.5", "chalk": "^4.1.2", "color-convert": "^2.0.1", "color-name": "^1.1.4", diff --git a/public/course_notes/notes-1700641832813.pdf b/public/course_notes/notes-1700641832813.pdf deleted file mode 100644 index 50fa054..0000000 Binary files a/public/course_notes/notes-1700641832813.pdf and /dev/null differ diff --git a/public/course_notes/notes-1700731141612.pdf b/public/course_notes/notes-1700731141612.pdf deleted file mode 100644 index 50fa054..0000000 Binary files a/public/course_notes/notes-1700731141612.pdf and /dev/null differ diff --git a/public/course_notes/notes-1700922068338.pptx b/public/course_notes/notes-1700922068338.pptx deleted file mode 100644 index a5e0fe5..0000000 Binary files a/public/course_notes/notes-1700922068338.pptx and /dev/null differ diff --git a/public/course_notes/notes-1700588095033.pdf b/public/course_notes/notes-1700952409794.pdf similarity index 100% rename from public/course_notes/notes-1700588095033.pdf rename to public/course_notes/notes-1700952409794.pdf diff --git a/public/course_notes/notes-1700641819491.pdf b/public/course_notes/notes-1700952480856.pdf similarity index 100% rename from public/course_notes/notes-1700641819491.pdf rename to public/course_notes/notes-1700952480856.pdf diff --git a/public/course_notes/notes-1700641824828.pdf b/public/course_notes/notes-1700952761296.pdf similarity index 100% rename from public/course_notes/notes-1700641824828.pdf rename to public/course_notes/notes-1700952761296.pdf diff --git a/public/course_videos/video-1700641819431-144p.mp4 b/public/course_videos/video-1700641819431-144p.mp4 deleted file mode 100644 index 8db6470..0000000 Binary files a/public/course_videos/video-1700641819431-144p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700641819431-360p.mp4 b/public/course_videos/video-1700641819431-360p.mp4 deleted file mode 100644 index be1bdf4..0000000 Binary files a/public/course_videos/video-1700641819431-360p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700641819431-720p.mp4 b/public/course_videos/video-1700641819431-720p.mp4 deleted file mode 100644 index a9d6f49..0000000 Binary files a/public/course_videos/video-1700641819431-720p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700641819431.mp4 b/public/course_videos/video-1700641819431.mp4 deleted file mode 100644 index 11a33aa..0000000 Binary files a/public/course_videos/video-1700641819431.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700641824771-144p.mp4 b/public/course_videos/video-1700641824771-144p.mp4 deleted file mode 100644 index 8db6470..0000000 Binary files a/public/course_videos/video-1700641824771-144p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700641824771-360p.mp4 b/public/course_videos/video-1700641824771-360p.mp4 deleted file mode 100644 index be1bdf4..0000000 Binary files a/public/course_videos/video-1700641824771-360p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700641824771-720p.mp4 b/public/course_videos/video-1700641824771-720p.mp4 deleted file mode 100644 index a9d6f49..0000000 Binary files a/public/course_videos/video-1700641824771-720p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700641824771.mp4 b/public/course_videos/video-1700641824771.mp4 deleted file mode 100644 index 11a33aa..0000000 Binary files a/public/course_videos/video-1700641824771.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700641832773-144p.mp4 b/public/course_videos/video-1700641832773-144p.mp4 deleted file mode 100644 index 8db6470..0000000 Binary files a/public/course_videos/video-1700641832773-144p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700641832773-360p.mp4 b/public/course_videos/video-1700641832773-360p.mp4 deleted file mode 100644 index be1bdf4..0000000 Binary files a/public/course_videos/video-1700641832773-360p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700641832773-720p.mp4 b/public/course_videos/video-1700641832773-720p.mp4 deleted file mode 100644 index a9d6f49..0000000 Binary files a/public/course_videos/video-1700641832773-720p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700641832773.mp4 b/public/course_videos/video-1700641832773.mp4 deleted file mode 100644 index 11a33aa..0000000 Binary files a/public/course_videos/video-1700641832773.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700731141369-144p.mp4 b/public/course_videos/video-1700731141369-144p.mp4 deleted file mode 100644 index 5dfb3d0..0000000 Binary files a/public/course_videos/video-1700731141369-144p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700731141369-360p.mp4 b/public/course_videos/video-1700731141369-360p.mp4 deleted file mode 100644 index d62fa70..0000000 Binary files a/public/course_videos/video-1700731141369-360p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700731141369-720p.mp4 b/public/course_videos/video-1700731141369-720p.mp4 deleted file mode 100644 index 5c6e406..0000000 Binary files a/public/course_videos/video-1700731141369-720p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700731141369.mp4 b/public/course_videos/video-1700731141369.mp4 deleted file mode 100644 index 8bb6be8..0000000 Binary files a/public/course_videos/video-1700731141369.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700922068277-144p.mp4 b/public/course_videos/video-1700922068277-144p.mp4 deleted file mode 100644 index 4dc85ff..0000000 Binary files a/public/course_videos/video-1700922068277-144p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700922068277-360p.mp4 b/public/course_videos/video-1700922068277-360p.mp4 deleted file mode 100644 index a29d44a..0000000 Binary files a/public/course_videos/video-1700922068277-360p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700922068277-720p.mp4 b/public/course_videos/video-1700922068277-720p.mp4 deleted file mode 100644 index 9e59996..0000000 Binary files a/public/course_videos/video-1700922068277-720p.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700922068277.mp4 b/public/course_videos/video-1700922068277.mp4 deleted file mode 100644 index 24bcebe..0000000 Binary files a/public/course_videos/video-1700922068277.mp4 and /dev/null differ diff --git a/public/course_videos/video-1700588084601-144p.mp4 b/public/course_videos/video-1700952409782-144p.mp4 similarity index 100% rename from public/course_videos/video-1700588084601-144p.mp4 rename to public/course_videos/video-1700952409782-144p.mp4 diff --git a/public/course_videos/video-1700588084601-360p.mp4 b/public/course_videos/video-1700952409782-360p.mp4 similarity index 100% rename from public/course_videos/video-1700588084601-360p.mp4 rename to public/course_videos/video-1700952409782-360p.mp4 diff --git a/public/course_videos/video-1700588084601-720p.mp4 b/public/course_videos/video-1700952409782-720p.mp4 similarity index 100% rename from public/course_videos/video-1700588084601-720p.mp4 rename to public/course_videos/video-1700952409782-720p.mp4 diff --git a/public/course_videos/video-1700588084601.mp4 b/public/course_videos/video-1700952409782.mp4 similarity index 100% rename from public/course_videos/video-1700588084601.mp4 rename to public/course_videos/video-1700952409782.mp4 diff --git a/public/course_videos/video-1700588095017-144p.mp4 b/public/course_videos/video-1700952480844-144p.mp4 similarity index 100% rename from public/course_videos/video-1700588095017-144p.mp4 rename to public/course_videos/video-1700952480844-144p.mp4 diff --git a/public/course_videos/video-1700588095017-360p.mp4 b/public/course_videos/video-1700952480844-360p.mp4 similarity index 100% rename from public/course_videos/video-1700588095017-360p.mp4 rename to public/course_videos/video-1700952480844-360p.mp4 diff --git a/public/course_videos/video-1700588095017-720p.mp4 b/public/course_videos/video-1700952480844-720p.mp4 similarity index 100% rename from public/course_videos/video-1700588095017-720p.mp4 rename to public/course_videos/video-1700952480844-720p.mp4 diff --git a/public/course_videos/video-1700588095017.mp4 b/public/course_videos/video-1700952480844.mp4 similarity index 100% rename from public/course_videos/video-1700588095017.mp4 rename to public/course_videos/video-1700952480844.mp4 diff --git a/public/course_videos/video-1700847491810-144p.mp4 b/public/course_videos/video-1700952761281-144p.mp4 similarity index 100% rename from public/course_videos/video-1700847491810-144p.mp4 rename to public/course_videos/video-1700952761281-144p.mp4 diff --git a/public/course_videos/video-1700847491810-360p.mp4 b/public/course_videos/video-1700952761281-360p.mp4 similarity index 100% rename from public/course_videos/video-1700847491810-360p.mp4 rename to public/course_videos/video-1700952761281-360p.mp4 diff --git a/public/course_videos/video-1700847491810-720p.mp4 b/public/course_videos/video-1700952761281-720p.mp4 similarity index 100% rename from public/course_videos/video-1700847491810-720p.mp4 rename to public/course_videos/video-1700952761281-720p.mp4 diff --git a/public/course_videos/video-1700847491810.mp4 b/public/course_videos/video-1700952761281.mp4 similarity index 100% rename from public/course_videos/video-1700847491810.mp4 rename to public/course_videos/video-1700952761281.mp4 diff --git a/public/thumbnail/1700586830219.png b/public/thumbnail/1700586830219.png deleted file mode 100644 index 96a2ae6..0000000 Binary files a/public/thumbnail/1700586830219.png and /dev/null differ diff --git a/public/thumbnail/1700588074268.png b/public/thumbnail/1700588074268.png deleted file mode 100644 index 96a2ae6..0000000 Binary files a/public/thumbnail/1700588074268.png and /dev/null differ diff --git a/public/thumbnail/1700641233096.png b/public/thumbnail/1700641233096.png deleted file mode 100644 index 96a2ae6..0000000 Binary files a/public/thumbnail/1700641233096.png and /dev/null differ diff --git a/public/thumbnail/1700641808376.png b/public/thumbnail/1700641808376.png deleted file mode 100644 index 96a2ae6..0000000 Binary files a/public/thumbnail/1700641808376.png and /dev/null differ diff --git a/public/thumbnail/1700714505070.png b/public/thumbnail/1700714505070.png deleted file mode 100644 index 96a2ae6..0000000 Binary files a/public/thumbnail/1700714505070.png and /dev/null differ diff --git a/public/thumbnail/1700847462625.png b/public/thumbnail/1700952401829.png similarity index 100% rename from public/thumbnail/1700847462625.png rename to public/thumbnail/1700952401829.png diff --git a/public/thumbnail/1700952469044.png b/public/thumbnail/1700952469044.png new file mode 100644 index 0000000..59e269a Binary files /dev/null and b/public/thumbnail/1700952469044.png differ diff --git a/public/thumbnail/1700952751749.png b/public/thumbnail/1700952751749.png new file mode 100644 index 0000000..59e269a Binary files /dev/null and b/public/thumbnail/1700952751749.png differ diff --git a/public/thumbnail/1700972907009.jpg b/public/thumbnail/1700972907009.jpg new file mode 100644 index 0000000..5cb774d Binary files /dev/null and b/public/thumbnail/1700972907009.jpg differ