diff options
| author | Pitu <[email protected]> | 2021-06-15 00:12:26 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2021-06-15 00:12:26 +0900 |
| commit | d3c80127ecdc83cffb9ba9a05f47452fec60287c (patch) | |
| tree | fb056e08947393a6487238b247703565f049a149 /src/api/routes/albums | |
| parent | chore: get host from req instead of config (diff) | |
| download | host.fuwn.me-d3c80127ecdc83cffb9ba9a05f47452fec60287c.tar.xz host.fuwn.me-d3c80127ecdc83cffb9ba9a05f47452fec60287c.zip | |
chore: update process.env usage
Diffstat (limited to 'src/api/routes/albums')
| -rw-r--r-- | src/api/routes/albums/albumZipGET.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/routes/albums/albumZipGET.js b/src/api/routes/albums/albumZipGET.js index 22b0b6f..8def099 100644 --- a/src/api/routes/albums/albumZipGET.js +++ b/src/api/routes/albums/albumZipGET.js @@ -38,13 +38,13 @@ class albumGET extends Route { If the date when the album was zipped is greater than the album's last edit, we just send the zip to the user */ if (album.zippedAt > album.editedAt) { - const filePath = path.join(__dirname, '../../../../', process.env.UPLOAD_FOLDER, 'zips', `${album.userId}-${album.id}.zip`); + const filePath = path.join(__dirname, '../../../../uploads', 'zips', `${album.userId}-${album.id}.zip`); const exists = await jetpack.existsAsync(filePath); /* Make sure the file exists just in case, and if not, continue to it's generation. */ if (exists) { - const fileName = `${process.env.SERVICE_NAME}-${identifier}.zip`; + const fileName = `${Util.config.serviceName}-${identifier}.zip`; return res.download(filePath, fileName); } } @@ -77,8 +77,8 @@ class albumGET extends Route { .update('zippedAt', db.fn.now()) .wasMutated(); - const filePath = path.join(__dirname, '../../../../', process.env.UPLOAD_FOLDER, 'zips', `${album.userId}-${album.id}.zip`); - const fileName = `${process.env.SERVICE_NAME}-${identifier}.zip`; + const filePath = path.join(__dirname, '../../../../uploads', 'zips', `${album.userId}-${album.id}.zip`); + const fileName = `${Util.config.serviceName}-${identifier}.zip`; return res.download(filePath, fileName); } catch (error) { log.error(error); |