if (res.locals.oauth) {
const user: User = res.locals.oauth.token.User
+
// User does not want NSFW videos
- if (user && user.nsfwPolicy === 'do_not_list') return false
+ if (user.nsfwPolicy === 'do_not_list') return false
+
+ // Both
+ return undefined
}
if (CONFIG.INSTANCE.DEFAULT_NSFW_POLICY === 'do_not_list') return false
import './video-blacklist'
import './video-blacklist-management'
import './video-captions'
-import './vidoe-change-ownership'
+import './video-change-ownership'
import './video-channels'
import './video-comments'
import './video-description'
})
it('Should display NSFW videos with blur user NSFW policy', async function () {
+ customConfig.instance.defaultNSFWPolicy = 'do_not_list'
+ await updateCustomConfig(server.url, server.accessToken, customConfig)
+
for (const res of await getVideosFunctions(userAccessToken)) {
expect(res.body.total).to.equal(2)