diff --git a/services/productsFileService.js b/services/productsFileService.js index a5fc0e6..3be2993 100644 --- a/services/productsFileService.js +++ b/services/productsFileService.js @@ -60,7 +60,7 @@ async function getProductFiles(productName, platform) { async function getFile(basePath, productName, productPlatform) { try { - const fixedPath = path.join(productsDataPath, productName, productPlatform, decodeURI(basePath)) + const fixedPath = path.join(productsDataPath, productName, "files", productPlatform, decodeURI(basePath)) const fileMetadata = await fs.promises.stat(fixedPath) if (fileMetadata.isDirectory()) { throw new DefaultError(409, "Can't download a directory", "", "NotDownloadableException") @@ -76,8 +76,8 @@ async function getFile(basePath, productName, productPlatform) { } } -async function canAccess(productName, productPlatform) { - const fixedPath = path.join(productsDataPath, productName, productPlatform, ".brikcfg") +async function canAccess(productName) { + const fixedPath = path.join(productsDataPath, productName, "files", ".brikcfg") const fileState = await fs.promises.exists(fixedPath, fs.constants.F_OK) if (!fileState) { return { code: 200 }