diff options
Diffstat (limited to 'server/helpers/utils.ts')
-rw-r--r-- | server/helpers/utils.ts | 9 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import * as Sequelize from 'sequelize' | ||
2 | import * as Promise from 'bluebird' | 3 | import * as Promise from 'bluebird' |
3 | 4 | ||
4 | import { pseudoRandomBytesPromise } from './core-utils' | 5 | import { pseudoRandomBytesPromise } from './core-utils' |
@@ -69,6 +70,13 @@ function computeResolutionsToTranscode (videoFileHeight: number) { | |||
69 | return resolutionsEnabled | 70 | return resolutionsEnabled |
70 | } | 71 | } |
71 | 72 | ||
73 | function 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 | |||
72 | type SortType = { sortModel: any, sortValue: string } | 80 | type 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 | } |