} from '../../middlewares'
import { VideoModel } from '../../models/video/video'
import { VideoChannelModel } from '../../models/video/video-channel'
-import { MChannelAccountDefault, MVideoAccountLightBlacklistAllFiles } from '../../typings/models'
+import { MChannelAccountDefault, MVideoAccountLightBlacklistAllFiles } from '../../types/models'
const searchRouter = express.Router()
// 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'
}