Use default nsfw instance policy for search index
This commit is contained in:
parent
5a61ffbb7c
commit
1a40132c67
2 changed files with 39 additions and 1 deletions
|
@ -169,7 +169,14 @@ async function searchVideosIndex (query: VideosSearchQuery, res: express.Respons
|
|||
|
||||
const result = await buildMutedForSearchIndex(res)
|
||||
|
||||
const body = Object.assign(query, result)
|
||||
const body: VideosSearchQuery = Object.assign(query, result)
|
||||
|
||||
// Use the default instance NSFW policy if not specified
|
||||
if (!body.nsfw) {
|
||||
body.nsfw = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list'
|
||||
? 'false'
|
||||
: 'both'
|
||||
}
|
||||
|
||||
const url = sanitizeUrl(CONFIG.SEARCH.SEARCH_INDEX.URL) + '/api/v1/search/videos'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue