MCPcopy Create free account
hub / github.com/NodeBB-Community/nodebb-plugin-recent-cards / getTopicsFromSet

Function getTopicsFromSet

library.js:115–133  ·  view source on GitHub ↗
(set)

Source from the content-addressed store, hash-verified

113 thumbsOnly: true,
114 };
115 async function getTopicsFromSet(set) {
116 let start = 0;
117 const topicsData = [];
118
119 do {
120 let tids = await db.getSortedSetRevRangeByScore(set, start, 20, Date.now(), '-inf');
121 if (!tids.length) {
122 break;
123 }
124
125 tids = await topics.filterNotIgnoredTids(tids, widget.uid);
126 let nextTopics = await topics.getTopics(tids, getTopicsOptions);
127
128 nextTopics = await user.blocks.filter(widget.uid, nextTopics);
129 topicsData.push(...nextTopics);
130 start += 20;
131 } while (topicsData.length < 20);
132 return { topics: topicsData.slice(0, 20) };
133 }
134
135 let topicsData = {
136 topics: [],

Callers 1

getTopicsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected