Add /admin page

This commit is contained in:
Christoph Wiechert
2017-07-12 15:19:53 +02:00
parent 4c2f5c1d94
commit 1bb9d5792f
10 changed files with 300 additions and 7 deletions

View File

@@ -116,6 +116,15 @@ module.exports = class DB {
}
async updateLastDownload(sid, key) {
debug(`Update last download ${sid}++${key}`);
const data = this.get(sid).find(item => item.key === key);
if(!data) return;
data.metadata.lastDownload = Date.now();
await this.store.update(`${sid}++${key}`, data);
}
get(sid) {
return this.db[sid];
}