Fix videos list user NSFW policy
This commit is contained in:
parent
6937f26a5e
commit
d1a63fc7ac
3 changed files with 7 additions and 6 deletions
|
@ -6,6 +6,7 @@ import { User } from '../../shared/models/users'
|
|||
import { deleteFileAsync, generateRandomString } from './utils'
|
||||
import { extname } from 'path'
|
||||
import { isArray } from './custom-validators/misc'
|
||||
import { UserModel } from '../models/account/user'
|
||||
|
||||
function buildNSFWFilter (res: express.Response, paramNSFW?: string) {
|
||||
if (paramNSFW === 'true') return true
|
||||
|
@ -13,7 +14,7 @@ function buildNSFWFilter (res: express.Response, paramNSFW?: string) {
|
|||
if (paramNSFW === 'both') return undefined
|
||||
|
||||
if (res.locals.oauth) {
|
||||
const user: User = res.locals.oauth.token.User
|
||||
const user: UserModel = res.locals.oauth.token.User
|
||||
|
||||
// User does not want NSFW videos
|
||||
if (user.nsfwPolicy === 'do_not_list') return false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue