diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-08 14:30:29 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-12-09 11:41:22 +0100 |
commit | b49f22d8f9a52ab75fd38db2d377249eb58fa678 (patch) | |
tree | a2825877d7b3b53454804a79c9d2a14c5d37385c /server/models/video/video-import.ts | |
parent | 6c8c15f914cd375da1db5d0cd4d924a86c53d4c1 (diff) | |
download | PeerTube-b49f22d8f9a52ab75fd38db2d377249eb58fa678.tar.gz PeerTube-b49f22d8f9a52ab75fd38db2d377249eb58fa678.tar.zst PeerTube-b49f22d8f9a52ab75fd38db2d377249eb58fa678.zip |
Upgrade sequelize to v6
Diffstat (limited to 'server/models/video/video-import.ts')
-rw-r--r-- | server/models/video/video-import.ts | 15 |
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' |
16 | import { CONSTRAINTS_FIELDS, VIDEO_IMPORT_STATES } from '../../initializers/constants' | 16 | import { MVideoImportDefault, MVideoImportFormattable } from '@server/types/models/video/video-import' |
17 | import { getSort, throwIfNotValid } from '../utils' | ||
18 | import { ScopeNames as VideoModelScopeNames, VideoModel } from './video' | ||
19 | import { isVideoImportStateValid, isVideoImportTargetUrlValid } from '../../helpers/custom-validators/video-imports' | ||
20 | import { VideoImport, VideoImportState } from '../../../shared' | 17 | import { VideoImport, VideoImportState } from '../../../shared' |
18 | import { isVideoImportStateValid, isVideoImportTargetUrlValid } from '../../helpers/custom-validators/video-imports' | ||
21 | import { isVideoMagnetUriValid } from '../../helpers/custom-validators/videos' | 19 | import { isVideoMagnetUriValid } from '../../helpers/custom-validators/videos' |
20 | import { CONSTRAINTS_FIELDS, VIDEO_IMPORT_STATES } from '../../initializers/constants' | ||
22 | import { UserModel } from '../account/user' | 21 | import { UserModel } from '../account/user' |
23 | import * as Bluebird from 'bluebird' | 22 | import { getSort, throwIfNotValid } from '../utils' |
24 | import { MVideoImportDefault, MVideoImportFormattable } from '@server/types/models/video/video-import' | 23 | import { 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 | }) |
55 | export class VideoImportModel extends Model<VideoImportModel> { | 54 | export 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 | ||