aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/database-utils.ts1
-rw-r--r--server/helpers/utils.ts9
2 files changed, 9 insertions, 1 deletions
diff --git a/server/helpers/database-utils.ts b/server/helpers/database-utils.ts
index 987e42eb0..dcc9e2577 100644
--- a/server/helpers/database-utils.ts
+++ b/server/helpers/database-utils.ts
@@ -1,6 +1,5 @@
1// TODO: import from ES6 when retry typing file will include errorFilter function 1// TODO: import from ES6 when retry typing file will include errorFilter function
2import * as retry from 'async/retry' 2import * as retry from 'async/retry'
3import * as Promise from 'bluebird'
4 3
5import { logger } from './logger' 4import { logger } from './logger'
6 5
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}