0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-18 07:52:41 +00:00

Merge branch 'master' into addCreditsSnippet-#283

This commit is contained in:
G.Ambatte
2023-10-19 16:37:27 +13:00
committed by GitHub

View File

@@ -327,6 +327,8 @@ app.get('/share/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, r
type : 'article' type : 'article'
}; };
// increase visitor view count, do not include visits by author(s)
if(!brew.authors.includes(req.account?.username)){
if(req.params.id.length > 12 && !brew._id) { if(req.params.id.length > 12 && !brew._id) {
const googleId = brew.googleId; const googleId = brew.googleId;
const shareId = brew.shareId; const shareId = brew.shareId;
@@ -335,6 +337,7 @@ app.get('/share/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, r
} else { } else {
await HomebrewModel.increaseView({ shareId: brew.shareId }); await HomebrewModel.increaseView({ shareId: brew.shareId });
} }
};
sanitizeBrew(req.brew, 'share'); sanitizeBrew(req.brew, 'share');
splitTextStyleAndMetadata(req.brew); splitTextStyleAndMetadata(req.brew);
return next(); return next();