diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/videos/import.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index cd9ba046d..82e084c54 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -1,4 +1,3 @@ | |||
1 | import * as Bluebird from 'bluebird' | ||
2 | import * as express from 'express' | 1 | import * as express from 'express' |
3 | import { move, readFile } from 'fs-extra' | 2 | import { move, readFile } from 'fs-extra' |
4 | import * as magnetUtil from 'magnet-uri' | 3 | import * as magnetUtil from 'magnet-uri' |
@@ -17,6 +16,7 @@ import { | |||
17 | } from '@server/types/models' | 16 | } from '@server/types/models' |
18 | import { MVideoImport, MVideoImportFormattable } from '@server/types/models/video/video-import' | 17 | import { MVideoImport, MVideoImportFormattable } from '@server/types/models/video/video-import' |
19 | import { VideoImportCreate, VideoImportState, VideoPrivacy, VideoState } from '../../../../shared' | 18 | import { VideoImportCreate, VideoImportState, VideoPrivacy, VideoState } from '../../../../shared' |
19 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
20 | import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type' | 20 | import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type' |
21 | import { auditLoggerFactory, getAuditIdFromRes, VideoImportAuditView } from '../../../helpers/audit-logger' | 21 | import { auditLoggerFactory, getAuditIdFromRes, VideoImportAuditView } from '../../../helpers/audit-logger' |
22 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' | 22 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' |
@@ -36,7 +36,6 @@ import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoIm | |||
36 | import { VideoModel } from '../../../models/video/video' | 36 | import { VideoModel } from '../../../models/video/video' |
37 | import { VideoCaptionModel } from '../../../models/video/video-caption' | 37 | import { VideoCaptionModel } from '../../../models/video/video-caption' |
38 | import { VideoImportModel } from '../../../models/video/video-import' | 38 | import { VideoImportModel } from '../../../models/video/video-import' |
39 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
40 | 39 | ||
41 | const auditLogger = auditLoggerFactory('video-imports') | 40 | const auditLogger = auditLoggerFactory('video-imports') |
42 | const videoImportsRouter = express.Router() | 41 | const videoImportsRouter = express.Router() |
@@ -314,7 +313,7 @@ function insertIntoDB (parameters: { | |||
314 | tags: string[] | 313 | tags: string[] |
315 | videoImportAttributes: Partial<MVideoImport> | 314 | videoImportAttributes: Partial<MVideoImport> |
316 | user: MUser | 315 | user: MUser |
317 | }): Bluebird<MVideoImportFormattable> { | 316 | }): Promise<MVideoImportFormattable> { |
318 | const { video, thumbnailModel, previewModel, videoChannel, tags, videoImportAttributes, user } = parameters | 317 | const { video, thumbnailModel, previewModel, videoChannel, tags, videoImportAttributes, user } = parameters |
319 | 318 | ||
320 | return sequelizeTypescript.transaction(async t => { | 319 | return sequelizeTypescript.transaction(async t => { |