1
0
mirror of https://github.com/fenwick67/mastofeed synced 2024-12-23 07:38:10 +01:00

fix default reply and boost options

This commit is contained in:
fenwick67 2018-03-24 18:33:22 -05:00
parent 0072386666
commit 71edc0a4e5
3 changed files with 40 additions and 28 deletions

View File

@ -46,6 +46,8 @@ app.get('/api/feed',function(req,res){
opts.header = true;
}
}
opts.boosts = true;
if (req.query.boosts){
if (req.query.boosts.toLowerCase() == 'no' || req.query.boosts.toLowerCase() == 'false'){
opts.boosts = false;
@ -53,6 +55,8 @@ app.get('/api/feed',function(req,res){
opts.boosts = true;
}
}
opts.replies = true;
if (req.query.replies){
if (req.query.replies.toLowerCase() == 'no' || req.query.replies.toLowerCase() == 'false'){
opts.replies = false;

View File

@ -173,6 +173,14 @@ function buildUp(jsonObj,opts){
item.isReply = true;
}
if(item.categories){
item.hasCw = item.categories.indexOf('nsfw') > -1;
if(item.hasCw){
item.cw = item.summary;
}
}
return true;
});