diff options
| author | Zephyrrus <[email protected]> | 2020-12-24 10:21:19 +0200 |
|---|---|---|
| committer | Zephyrrus <[email protected]> | 2020-12-24 10:21:19 +0200 |
| commit | 13825ddae6f41fdf2697f451cff6c8af0240c2e8 (patch) | |
| tree | c40f73b9fc481b90e764e2a629dfd53365a4c2c3 /src/api | |
| parent | Merge pull request #4 from Zephyrrus/chore/update_buefy (diff) | |
| download | host.fuwn.me-13825ddae6f41fdf2697f451cff6c8af0240c2e8.tar.xz host.fuwn.me-13825ddae6f41fdf2697f451cff6c8af0240c2e8.zip | |
chore: update lock files
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/routes/uploads/chunksPOST.js | 15 | ||||
| -rw-r--r-- | src/api/utils/ThumbUtil.js | 4 |
2 files changed, 5 insertions, 14 deletions
diff --git a/src/api/routes/uploads/chunksPOST.js b/src/api/routes/uploads/chunksPOST.js index a9baf55..789a5e7 100644 --- a/src/api/routes/uploads/chunksPOST.js +++ b/src/api/routes/uploads/chunksPOST.js @@ -25,20 +25,14 @@ class uploadPOST extends Route { // console.log('Chunk', chunk); const chunkOutput = path.join(__dirname, - '..', - '..', - '..', - '..', + '../../../../', process.env.UPLOAD_FOLDER, 'chunks', uuid); const chunkDir = await jetpack.list(chunkOutput); const ext = path.extname(chunkDir[0]); const output = path.join(__dirname, - '..', - '..', - '..', - '..', + '../../../../', process.env.UPLOAD_FOLDER, `${filename}${ext || ''}`); chunkDir.sort(); @@ -49,10 +43,7 @@ class uploadPOST extends Route { for (let i = 0; i < chunkDir.length; i++) { const dir = path.join(__dirname, - '..', - '..', - '..', - '..', + '../../../../', process.env.UPLOAD_FOLDER, 'chunks', uuid, diff --git a/src/api/utils/ThumbUtil.js b/src/api/utils/ThumbUtil.js index 98ba5c0..6a22c3b 100644 --- a/src/api/utils/ThumbUtil.js +++ b/src/api/utils/ThumbUtil.js @@ -30,7 +30,7 @@ class ThumbUtil { } static async generateThumbnailForImage(filename, output) { - const filePath = path.join(__dirname, '..', '..', '..', process.env.UPLOAD_FOLDER, filename); + const filePath = path.join(__dirname, '../../../', process.env.UPLOAD_FOLDER, filename); const file = await jetpack.readAsync(filePath, 'buffer'); await sharp(file) @@ -44,7 +44,7 @@ class ThumbUtil { } static async generateThumbnailForVideo(filename, output) { - const filePath = path.join(__dirname, '..', '..', '..', process.env.UPLOAD_FOLDER, filename); + const filePath = path.join(__dirname, '../../../', process.env.UPLOAD_FOLDER, filename); ffmpeg(filePath) .thumbnail({ |