diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/database-utils.ts | 1 | ||||
-rw-r--r-- | server/helpers/utils.ts | 9 |
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 |
2 | import * as retry from 'async/retry' | 2 | import * as retry from 'async/retry' |
3 | import * as Promise from 'bluebird' | ||
4 | 3 | ||
5 | import { logger } from './logger' | 4 | import { 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 @@ | |||
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 | } |