Use correct size param
This commit is contained in:
parent
25a3dfc456
commit
d30b0987ad
1 changed files with 7 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue