diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-12 20:04:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-12 20:37:51 +0200 |
commit | 2186386cca113506791583cb07d6ccacba7af4e0 (patch) | |
tree | 3c214c0b5fbd64332624267fa6e51fd4a9cf6474 /server/controllers/api/users.ts | |
parent | 6ccdf3a23ecec5ba2eeaf487fd1fafdc7606b4bf (diff) | |
download | PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.tar.gz PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.tar.zst PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.zip |
Add concept of video state, and add ability to wait transcoding before
publishing a video
Diffstat (limited to 'server/controllers/api/users.ts')
-rw-r--r-- | server/controllers/api/users.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts index 8dff4b87c..2b40c44d9 100644 --- a/server/controllers/api/users.ts +++ b/server/controllers/api/users.ts | |||
@@ -166,7 +166,7 @@ export { | |||
166 | 166 | ||
167 | async function getUserVideos (req: express.Request, res: express.Response, next: express.NextFunction) { | 167 | async function getUserVideos (req: express.Request, res: express.Response, next: express.NextFunction) { |
168 | const user = res.locals.oauth.token.User as UserModel | 168 | const user = res.locals.oauth.token.User as UserModel |
169 | const resultList = await VideoModel.listAccountVideosForApi( | 169 | const resultList = await VideoModel.listUserVideosForApi( |
170 | user.Account.id, | 170 | user.Account.id, |
171 | req.query.start as number, | 171 | req.query.start as number, |
172 | req.query.count as number, | 172 | req.query.count as number, |
@@ -174,7 +174,8 @@ async function getUserVideos (req: express.Request, res: express.Response, next: | |||
174 | false // Display my NSFW videos | 174 | false // Display my NSFW videos |
175 | ) | 175 | ) |
176 | 176 | ||
177 | return res.json(getFormattedObjects(resultList.data, resultList.total)) | 177 | const additionalAttributes = { waitTranscoding: true, state: true } |
178 | return res.json(getFormattedObjects(resultList.data, resultList.total, { additionalAttributes })) | ||
178 | } | 179 | } |
179 | 180 | ||
180 | async function createUserRetryWrapper (req: express.Request, res: express.Response, next: express.NextFunction) { | 181 | async function createUserRetryWrapper (req: express.Request, res: express.Response, next: express.NextFunction) { |
@@ -318,7 +319,7 @@ async function updateMe (req: express.Request, res: express.Response, next: expr | |||
318 | } | 319 | } |
319 | 320 | ||
320 | async function updateMyAvatar (req: express.Request, res: express.Response, next: express.NextFunction) { | 321 | async function updateMyAvatar (req: express.Request, res: express.Response, next: express.NextFunction) { |
321 | const avatarPhysicalFile = req.files['avatarfile'][0] | 322 | const avatarPhysicalFile = req.files[ 'avatarfile' ][ 0 ] |
322 | const user = res.locals.oauth.token.user | 323 | const user = res.locals.oauth.token.user |
323 | const actor = user.Account.Actor | 324 | const actor = user.Account.Actor |
324 | 325 | ||