aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-03-06 11:32:53 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commitd4c9f45b31eda0b7a391ddc83eb290ca5cba311f (patch)
tree657a47aafc71f67d86718d2de8d4c0f878367331 /server/controllers
parent9c6ca37fc1512a99d420ea90707cebcd06cdc970 (diff)
downloadPeerTube-d4c9f45b31eda0b7a391ddc83eb290ca5cba311f.tar.gz
PeerTube-d4c9f45b31eda0b7a391ddc83eb290ca5cba311f.tar.zst
PeerTube-d4c9f45b31eda0b7a391ddc83eb290ca5cba311f.zip
Add server migrations
Diffstat (limited to 'server/controllers')
-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