From d30b0987ad0c367bfa07220fb0f3c6af25a7b930 Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Sat, 22 Aug 2015 18:48:34 +0100 Subject: [PATCH] Use correct size param --- web/routes/file.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/web/routes/file.js b/web/routes/file.js index 9a624bf..f402558 100644 --- a/web/routes/file.js +++ b/web/routes/file.js @@ -68,11 +68,13 @@ export function* get() { this.set('Expires', new Date(2020, 1).toISOString()); this.set('Cache-control', 'max-age=2592000'); - this.db.Files.updateOne( - {_id: file._id}, - {'$set': {'last_accessed': Math.ceil(Date.now()/1000)}, '$inc': {downloads: 1}}, - {w:0} - ); + if (!this.params.size || (this.params.size && this.params.size > 150)) { + this.db.Files.updateOne( + {_id: file._id}, + {'$set': {'last_accessed': Math.ceil(Date.now()/1000)}, '$inc': {downloads: 1}}, + {w:0} + ); + } this.body = yield hostrFileStream(localPath, remotePath); }