Fix global search nsfw policy when logged in
This commit is contained in:
parent
228393302d
commit
ba11402435
|
@ -173,7 +173,11 @@ async function searchVideosIndex (query: VideosSearchQuery, res: express.Respons
|
|||
|
||||
// Use the default instance NSFW policy if not specified
|
||||
if (!body.nsfw) {
|
||||
body.nsfw = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list'
|
||||
const nsfwPolicy = res.locals.oauth
|
||||
? res.locals.oauth.token.User.nsfwPolicy
|
||||
: CONFIG.INSTANCE.DEFAULT_NSFW_POLICY
|
||||
|
||||
body.nsfw = nsfwPolicy === 'do_not_list'
|
||||
? 'false'
|
||||
: 'both'
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue