From 5236a7e242a239b53baf600c0843c7e9339343b9 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 8 Jan 2018 15:30:26 +0100 Subject: fetch thread file sizes correctly --- bucky/app/bucky.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bucky/app/bucky.js') diff --git a/bucky/app/bucky.js b/bucky/app/bucky.js index 940e02d..0581bc9 100644 --- a/bucky/app/bucky.js +++ b/bucky/app/bucky.js @@ -30,7 +30,7 @@ var bucky = module.exports = { }) }, ensureFileCountsForThreads: function (req, res, next){ - db.getFileCounts(res.threads_ids).then(function(counts){ + db.getFileSizes(res.threads_ids).then(function(counts){ var lookup = {} counts.forEach(function(c){ lookup[c.thread] = c @@ -38,6 +38,7 @@ var bucky = module.exports = { res.threads.forEach(function(t){ var c = lookup[t.id] t.set("file_count", c ? c.count : 0) + t.set("size", c ? c.size : 0) }) next() }) -- cgit v1.2.3-70-g09d2