fixup citation weights for ss import

This commit is contained in:
Ladd Hoffman 2024-04-21 12:51:38 -05:00
parent 88e397d197
commit f1bb21c9ad
1 changed files with 3 additions and 2 deletions

View File

@ -152,9 +152,10 @@ module.exports = async (req, res) => {
console.log('references count:', paper.references.length);
const eachCitationWeightPercent = Math.floor(PPM_TO_CITATIONS / paper.references.length);
const references = paper.references.filter((x) => !!x.paperId);
const eachCitationWeightPercent = Math.floor(PPM_TO_CITATIONS / references.length);
const citations = await Promise.mapSeries(
paper.references.filter((x) => !!x.paperId),
references,
async (citedPaper) => {
// We need to fetch this paper so we can generate the post we WOULD add to the forum.
// That way, if we later add the cited paper to the blockchain it will have the correct hash.