aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-import.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video-import.ts')
-rw-r--r--server/models/video/video-import.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/server/models/video/video-import.ts b/server/models/video/video-import.ts
index ea1e085af..f3ed651b2 100644
--- a/server/models/video/video-import.ts
+++ b/server/models/video/video-import.ts
@@ -13,15 +13,14 @@ import {
13 Table, 13 Table,
14 UpdatedAt 14 UpdatedAt
15} from 'sequelize-typescript' 15} from 'sequelize-typescript'
16import { CONSTRAINTS_FIELDS, VIDEO_IMPORT_STATES } from '../../initializers/constants' 16import { MVideoImportDefault, MVideoImportFormattable } from '@server/types/models/video/video-import'
17import { getSort, throwIfNotValid } from '../utils'
18import { ScopeNames as VideoModelScopeNames, VideoModel } from './video'
19import { isVideoImportStateValid, isVideoImportTargetUrlValid } from '../../helpers/custom-validators/video-imports'
20import { VideoImport, VideoImportState } from '../../../shared' 17import { VideoImport, VideoImportState } from '../../../shared'
18import { isVideoImportStateValid, isVideoImportTargetUrlValid } from '../../helpers/custom-validators/video-imports'
21import { isVideoMagnetUriValid } from '../../helpers/custom-validators/videos' 19import { isVideoMagnetUriValid } from '../../helpers/custom-validators/videos'
20import { CONSTRAINTS_FIELDS, VIDEO_IMPORT_STATES } from '../../initializers/constants'
22import { UserModel } from '../account/user' 21import { UserModel } from '../account/user'
23import * as Bluebird from 'bluebird' 22import { getSort, throwIfNotValid } from '../utils'
24import { MVideoImportDefault, MVideoImportFormattable } from '@server/types/models/video/video-import' 23import { ScopeNames as VideoModelScopeNames, VideoModel } from './video'
25 24
26@DefaultScope(() => ({ 25@DefaultScope(() => ({
27 include: [ 26 include: [
@@ -52,7 +51,7 @@ import { MVideoImportDefault, MVideoImportFormattable } from '@server/types/mode
52 } 51 }
53 ] 52 ]
54}) 53})
55export class VideoImportModel extends Model<VideoImportModel> { 54export class VideoImportModel extends Model {
56 @CreatedAt 55 @CreatedAt
57 createdAt: Date 56 createdAt: Date
58 57
@@ -120,7 +119,7 @@ export class VideoImportModel extends Model<VideoImportModel> {
120 return undefined 119 return undefined
121 } 120 }
122 121
123 static loadAndPopulateVideo (id: number): Bluebird<MVideoImportDefault> { 122 static loadAndPopulateVideo (id: number): Promise<MVideoImportDefault> {
124 return VideoImportModel.findByPk(id) 123 return VideoImportModel.findByPk(id)
125 } 124 }
126 125