From 4ea4cfb0257f00b925083c064f533e9d6832e19a Mon Sep 17 00:00:00 2001 From: Nadav Ivgi Date: Sun, 17 Dec 2017 20:01:51 +0200 Subject: [PATCH] only files have attrs --- lib/files.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/files.js b/lib/files.js index 0542a6c..0aa5e99 100644 --- a/lib/files.js +++ b/lib/files.js @@ -25,11 +25,11 @@ module.exports = (base, default_price, invoice_ttl, files_attr) => { if (/^\.\.\//.test(relpath) || reIgnore.test(name)) throw new Error('forbidden') - const file = { fullpath, path: relpath, urlpath: escape(relpath), name, ext, dirname, attr } + const file = { fullpath, path: relpath, urlpath: escape(relpath), name, ext, dirname } , stat = await fs.stat(fullpath) return stat.isDirectory() ? { ...file, type: 'dir', files: !shallow && await listFiles(fullpath) } - : stat.isFile() ? { ...file, type: 'file', size: stat.size, price: attr.price || default_price + : stat.isFile() ? { ...file, type: 'file', size: stat.size, attr, price: attr.price || default_price , mime: await getMime(file), exif: !shallow && await getExif(fullpath) } : null }