1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Add sitemap

This commit is contained in:
Chocobozzz 2018-12-05 17:27:24 +01:00
parent 3b3b18203f
commit 2feebf3e6a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
11 changed files with 241 additions and 4 deletions

View file

@ -7,12 +7,12 @@ import { extname } from 'path'
import { isArray } from './custom-validators/misc'
import { UserModel } from '../models/account/user'
function buildNSFWFilter (res: express.Response, paramNSFW?: string) {
function buildNSFWFilter (res?: express.Response, paramNSFW?: string) {
if (paramNSFW === 'true') return true
if (paramNSFW === 'false') return false
if (paramNSFW === 'both') return undefined
if (res.locals.oauth) {
if (res && res.locals.oauth) {
const user: UserModel = res.locals.oauth.token.User
// User does not want NSFW videos