aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/video-playlist.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts
index 2700e8dc7..145764d35 100644
--- a/server/controllers/api/video-playlist.ts
+++ b/server/controllers/api/video-playlist.ts
@@ -13,7 +13,7 @@ import {
13import { VideoChannelModel } from '../../models/video/video-channel' 13import { VideoChannelModel } from '../../models/video/video-channel'
14import { videoPlaylistsSortValidator } from '../../middlewares/validators' 14import { videoPlaylistsSortValidator } from '../../middlewares/validators'
15import { buildNSFWFilter, createReqFiles, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' 15import { buildNSFWFilter, createReqFiles, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils'
16import { CONFIG, MIMETYPES, sequelizeTypescript, THUMBNAILS_SIZE } from '../../initializers' 16import { CONFIG, MIMETYPES, sequelizeTypescript, THUMBNAILS_SIZE, VIDEO_PLAYLIST_PRIVACIES } from '../../initializers'
17import { logger } from '../../helpers/logger' 17import { logger } from '../../helpers/logger'
18import { resetSequelizeInstance } from '../../helpers/database-utils' 18import { resetSequelizeInstance } from '../../helpers/database-utils'
19import { VideoPlaylistModel } from '../../models/video/video-playlist' 19import { VideoPlaylistModel } from '../../models/video/video-playlist'
@@ -46,6 +46,8 @@ const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIM
46 46
47const videoPlaylistRouter = express.Router() 47const videoPlaylistRouter = express.Router()
48 48
49videoPlaylistRouter.get('/privacies', listVideoPlaylistPrivacies)
50
49videoPlaylistRouter.get('/', 51videoPlaylistRouter.get('/',
50 paginationValidator, 52 paginationValidator,
51 videoPlaylistsSortValidator, 53 videoPlaylistsSortValidator,
@@ -121,6 +123,10 @@ export {
121 123
122// --------------------------------------------------------------------------- 124// ---------------------------------------------------------------------------
123 125
126function listVideoPlaylistPrivacies (req: express.Request, res: express.Response) {
127 res.json(VIDEO_PLAYLIST_PRIVACIES)
128}
129
124async function listVideoPlaylists (req: express.Request, res: express.Response) { 130async function listVideoPlaylists (req: express.Request, res: express.Response) {
125 const serverActor = await getServerActor() 131 const serverActor = await getServerActor()
126 const resultList = await VideoPlaylistModel.listForApi({ 132 const resultList = await VideoPlaylistModel.listForApi({
@@ -153,7 +159,7 @@ async function addVideoPlaylist (req: express.Request, res: express.Response) {
153 159
154 videoPlaylist.url = getVideoPlaylistActivityPubUrl(videoPlaylist) // We use the UUID, so set the URL after building the object 160 videoPlaylist.url = getVideoPlaylistActivityPubUrl(videoPlaylist) // We use the UUID, so set the URL after building the object
155 161
156 if (videoPlaylistInfo.videoChannelId !== undefined) { 162 if (videoPlaylistInfo.videoChannelId) {
157 const videoChannel = res.locals.videoChannel as VideoChannelModel 163 const videoChannel = res.locals.videoChannel as VideoChannelModel
158 164
159 videoPlaylist.videoChannelId = videoChannel.id 165 videoPlaylist.videoChannelId = videoChannel.id