2017-08-31 16:43:36 +00:00
|
|
|
const storage = require('../storage');
|
|
|
|
|
|
|
|
module.exports = async function(req, res) {
|
|
|
|
const id = req.params.id;
|
2018-02-06 22:31:18 +00:00
|
|
|
const meta = req.meta;
|
2017-08-31 16:43:36 +00:00
|
|
|
try {
|
|
|
|
const ttl = await storage.ttl(id);
|
|
|
|
res.send({
|
|
|
|
metadata: meta.metadata,
|
2018-02-06 22:31:18 +00:00
|
|
|
finalDownload: meta.dl + 1 === meta.dlimit,
|
2017-08-31 16:43:36 +00:00
|
|
|
ttl
|
|
|
|
});
|
|
|
|
} catch (e) {
|
|
|
|
res.sendStatus(404);
|
|
|
|
}
|
|
|
|
};
|