aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/utils.ts')
-rw-r--r--server/helpers/utils.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/helpers/utils.ts b/server/helpers/utils.ts
index 3317dddc3..6cabe117c 100644
--- a/server/helpers/utils.ts
+++ b/server/helpers/utils.ts
@@ -1,4 +1,5 @@
1import * as express from 'express' 1import * as express from 'express'
2import * as Sequelize from 'sequelize'
2import * as Promise from 'bluebird' 3import * as Promise from 'bluebird'
3 4
4import { pseudoRandomBytesPromise } from './core-utils' 5import { pseudoRandomBytesPromise } from './core-utils'
@@ -69,6 +70,13 @@ function computeResolutionsToTranscode (videoFileHeight: number) {
69 return resolutionsEnabled 70 return resolutionsEnabled
70} 71}
71 72
73function resetSequelizeInstance (instance: Sequelize.Instance<any>, savedFields: object) {
74 Object.keys(savedFields).forEach(key => {
75 const value = savedFields[key]
76 instance.set(key, value)
77 })
78}
79
72type SortType = { sortModel: any, sortValue: string } 80type SortType = { sortModel: any, sortValue: string }
73 81
74// --------------------------------------------------------------------------- 82// ---------------------------------------------------------------------------
@@ -79,5 +87,6 @@ export {
79 getFormattedObjects, 87 getFormattedObjects,
80 isSignupAllowed, 88 isSignupAllowed,
81 computeResolutionsToTranscode, 89 computeResolutionsToTranscode,
90 resetSequelizeInstance,
82 SortType 91 SortType
83} 92}