aboutsummaryrefslogtreecommitdiff
path: root/src/api/routes/albums/albumZipGET.js
diff options
context:
space:
mode:
authorKana <[email protected]>2021-06-19 02:03:57 +0900
committerGitHub <[email protected]>2021-06-19 02:03:57 +0900
commit065c5221a0250838f1d1f9bb7a7922ff4f55e038 (patch)
tree8a69a81f00e6bff2752f4f7c59dcbbf21f893b20 /src/api/routes/albums/albumZipGET.js
parentchore: docs update (diff)
parentfix: potentially fix the blocked extensions array splitting (diff)
downloadhost.fuwn.me-065c5221a0250838f1d1f9bb7a7922ff4f55e038.tar.xz
host.fuwn.me-065c5221a0250838f1d1f9bb7a7922ff4f55e038.zip
Merge pull request #278 from Zephyrrus/Zephyrrus-feature/database_based_settings
Zephyrrus feature/database based settings
Diffstat (limited to 'src/api/routes/albums/albumZipGET.js')
-rw-r--r--src/api/routes/albums/albumZipGET.js8
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);