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:
parent
5f04dd2f74
commit
eb08047657
20 changed files with 823 additions and 992 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue