isekai-main
Barış Soner Uşaklı 3 years ago
parent ec143ebc4b
commit b6f8e2fd05

@ -113,6 +113,13 @@ module.exports = function (Topics) {
await db.sortedSetAdd('tags:topic:count', 0, tag);
cache.del('tags:topic:count');
}
const allCids = await categories.getAllCidsFromSet('categories:cid');
const isMembers = await db.isMemberOfSortedSets(
allCids.map(cid => `cid:${cid}:tags`), tag
);
const bulkAdd = allCids.filter((cid, index) => !isMembers[index])
.map(cid => ([`cid:${cid}:tags`, 0, tag]));
await db.sortedSetAddBulk(bulkAdd);
};
Topics.renameTags = async function (data) {

Loading…
Cancel
Save