diff options
Diffstat (limited to 'src/api/routes/albums/albumZipGET.js')
| -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); |