aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/search.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/controllers/api/search.ts b/server/controllers/api/search.ts
index 1dea77d29..e35a7346e 100644
--- a/server/controllers/api/search.ts
+++ b/server/controllers/api/search.ts
@@ -169,7 +169,14 @@ async function searchVideosIndex (query: VideosSearchQuery, res: express.Respons
169 169
170 const result = await buildMutedForSearchIndex(res) 170 const result = await buildMutedForSearchIndex(res)
171 171
172 const body = Object.assign(query, result) 172 const body: VideosSearchQuery = Object.assign(query, result)
173
174 // Use the default instance NSFW policy if not specified
175 if (!body.nsfw) {
176 body.nsfw = CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list'
177 ? 'false'
178 : 'both'
179 }
173 180
174 const url = sanitizeUrl(CONFIG.SEARCH.SEARCH_INDEX.URL) + '/api/v1/search/videos' 181 const url = sanitizeUrl(CONFIG.SEARCH.SEARCH_INDEX.URL) + '/api/v1/search/videos'
175 182