diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-06 11:32:53 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-03-18 11:17:59 +0100 |
commit | d4c9f45b31eda0b7a391ddc83eb290ca5cba311f (patch) | |
tree | 657a47aafc71f67d86718d2de8d4c0f878367331 /server/controllers/api | |
parent | 9c6ca37fc1512a99d420ea90707cebcd06cdc970 (diff) | |
download | PeerTube-d4c9f45b31eda0b7a391ddc83eb290ca5cba311f.tar.gz PeerTube-d4c9f45b31eda0b7a391ddc83eb290ca5cba311f.tar.zst PeerTube-d4c9f45b31eda0b7a391ddc83eb290ca5cba311f.zip |
Add server migrations
Diffstat (limited to 'server/controllers/api')
-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 |