1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Use async/await in controllers

This commit is contained in:
Chocobozzz 2017-10-25 11:55:06 +02:00
parent 5f04dd2f74
commit eb08047657
No known key found for this signature in database
GPG key ID: 583A612D890159BE
20 changed files with 823 additions and 992 deletions

View file

@ -1,4 +1,5 @@
import * as express from 'express'
import * as Sequelize from 'sequelize'
import * as Promise from 'bluebird'
import { pseudoRandomBytesPromise } from './core-utils'
@ -69,6 +70,13 @@ function computeResolutionsToTranscode (videoFileHeight: number) {
return resolutionsEnabled
}
function resetSequelizeInstance (instance: Sequelize.Instance<any>, savedFields: object) {
Object.keys(savedFields).forEach(key => {
const value = savedFields[key]
instance.set(key, value)
})
}
type SortType = { sortModel: any, sortValue: string }
// ---------------------------------------------------------------------------
@ -79,5 +87,6 @@ export {
getFormattedObjects,
isSignupAllowed,
computeResolutionsToTranscode,
resetSequelizeInstance,
SortType
}