|
|
|
@ -77,7 +77,7 @@ var async = require('async'),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Topics.getPageCount = function(tid, uid, callback) {
|
|
|
|
|
db.sortedSetCard('tid:' + tid + ':posts', function(err, postCount) {
|
|
|
|
|
Topics.getTopicField(tid, 'postcount', function(err, postCount) {
|
|
|
|
|
if (err) {
|
|
|
|
|
return callback(err);
|
|
|
|
|
}
|
|
|
|
@ -352,9 +352,16 @@ var async = require('async'),
|
|
|
|
|
|
|
|
|
|
async.parallel({
|
|
|
|
|
counts: function(next) {
|
|
|
|
|
async.map(tids, function(tid, next) {
|
|
|
|
|
db.sortedSetCard('tid:' + tid + ':posts', next);
|
|
|
|
|
}, next);
|
|
|
|
|
Topics.getTopicsFields(tids, ['postcount'], function(err, topics) {
|
|
|
|
|
if (err) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
topics = topics.map(function(topic) {
|
|
|
|
|
return topic && topic.postcount;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
next(null, topics);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
pids: function(next) {
|
|
|
|
|
async.map(tids, function(tid, next) {
|
|
|
|
|