diff options
author | Chocobozzz <me@florianbigard.com> | 2023-01-19 15:04:10 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-01-19 15:04:10 +0100 |
commit | a68ccaead667f1b976e0fb10c8b1087af25547f2 (patch) | |
tree | b23ef1915c1b8bdb6b88c10d0dee5749fa874133 /server/controllers/api | |
parent | 789ba349318e7ff012590491e76087a1204cccd4 (diff) | |
download | PeerTube-a68ccaead667f1b976e0fb10c8b1087af25547f2.tar.gz PeerTube-a68ccaead667f1b976e0fb10c8b1087af25547f2.tar.zst PeerTube-a68ccaead667f1b976e0fb10c8b1087af25547f2.zip |
(breaking): Always list nsfw videos in playlists
Keep the same behaviour as unlisted videos
The frontend is in charge to blur the video element if the nsfw setting
is "hide" or "blur"
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/video-playlist.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts index f8a607170..947f7ca77 100644 --- a/server/controllers/api/video-playlist.ts +++ b/server/controllers/api/video-playlist.ts | |||
@@ -15,7 +15,7 @@ import { VideoPlaylistPrivacy } from '../../../shared/models/videos/playlist/vid | |||
15 | import { VideoPlaylistReorder } from '../../../shared/models/videos/playlist/video-playlist-reorder.model' | 15 | import { VideoPlaylistReorder } from '../../../shared/models/videos/playlist/video-playlist-reorder.model' |
16 | import { VideoPlaylistUpdate } from '../../../shared/models/videos/playlist/video-playlist-update.model' | 16 | import { VideoPlaylistUpdate } from '../../../shared/models/videos/playlist/video-playlist-update.model' |
17 | import { resetSequelizeInstance } from '../../helpers/database-utils' | 17 | import { resetSequelizeInstance } from '../../helpers/database-utils' |
18 | import { buildNSFWFilter, createReqFiles } from '../../helpers/express-utils' | 18 | import { createReqFiles } from '../../helpers/express-utils' |
19 | import { logger } from '../../helpers/logger' | 19 | import { logger } from '../../helpers/logger' |
20 | import { getFormattedObjects } from '../../helpers/utils' | 20 | import { getFormattedObjects } from '../../helpers/utils' |
21 | import { CONFIG } from '../../initializers/config' | 21 | import { CONFIG } from '../../initializers/config' |
@@ -474,10 +474,7 @@ async function getVideoPlaylistVideos (req: express.Request, res: express.Respon | |||
474 | 'filter:api.video-playlist.videos.list.result' | 474 | 'filter:api.video-playlist.videos.list.result' |
475 | ) | 475 | ) |
476 | 476 | ||
477 | const options = { | 477 | const options = { accountId: user?.Account?.id } |
478 | displayNSFW: buildNSFWFilter(res, req.query.nsfw), | ||
479 | accountId: user ? user.Account.id : undefined | ||
480 | } | ||
481 | return res.json(getFormattedObjects(resultList.data, resultList.total, options)) | 478 | return res.json(getFormattedObjects(resultList.data, resultList.total, options)) |
482 | } | 479 | } |
483 | 480 | ||