diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/video-playlist.ts | 10 |
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 { | |||
13 | import { VideoChannelModel } from '../../models/video/video-channel' | 13 | import { VideoChannelModel } from '../../models/video/video-channel' |
14 | import { videoPlaylistsSortValidator } from '../../middlewares/validators' | 14 | import { videoPlaylistsSortValidator } from '../../middlewares/validators' |
15 | import { buildNSFWFilter, createReqFiles, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' | 15 | import { buildNSFWFilter, createReqFiles, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' |
16 | import { CONFIG, MIMETYPES, sequelizeTypescript, THUMBNAILS_SIZE } from '../../initializers' | 16 | import { CONFIG, MIMETYPES, sequelizeTypescript, THUMBNAILS_SIZE, VIDEO_PLAYLIST_PRIVACIES } from '../../initializers' |
17 | import { logger } from '../../helpers/logger' | 17 | import { logger } from '../../helpers/logger' |
18 | import { resetSequelizeInstance } from '../../helpers/database-utils' | 18 | import { resetSequelizeInstance } from '../../helpers/database-utils' |
19 | import { VideoPlaylistModel } from '../../models/video/video-playlist' | 19 | import { VideoPlaylistModel } from '../../models/video/video-playlist' |
@@ -46,6 +46,8 @@ const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIM | |||
46 | 46 | ||
47 | const videoPlaylistRouter = express.Router() | 47 | const videoPlaylistRouter = express.Router() |
48 | 48 | ||
49 | videoPlaylistRouter.get('/privacies', listVideoPlaylistPrivacies) | ||
50 | |||
49 | videoPlaylistRouter.get('/', | 51 | videoPlaylistRouter.get('/', |
50 | paginationValidator, | 52 | paginationValidator, |
51 | videoPlaylistsSortValidator, | 53 | videoPlaylistsSortValidator, |
@@ -121,6 +123,10 @@ export { | |||
121 | 123 | ||
122 | // --------------------------------------------------------------------------- | 124 | // --------------------------------------------------------------------------- |
123 | 125 | ||
126 | function listVideoPlaylistPrivacies (req: express.Request, res: express.Response) { | ||
127 | res.json(VIDEO_PLAYLIST_PRIVACIES) | ||
128 | } | ||
129 | |||
124 | async function listVideoPlaylists (req: express.Request, res: express.Response) { | 130 | async 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 |