diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-24 10:14:47 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-24 10:14:47 +0100 |
commit | d17c7b4e8c52317bdc874917387b7a49f6cf8b01 (patch) | |
tree | 83a736f566f8cb4c696fa8e59086a523bbb4b4bf /server/controllers/api/videos | |
parent | 1e9c1b1b44b4cbd4bc4b1e97e8e6ba2df93371de (diff) | |
download | PeerTube-d17c7b4e8c52317bdc874917387b7a49f6cf8b01.tar.gz PeerTube-d17c7b4e8c52317bdc874917387b7a49f6cf8b01.tar.zst PeerTube-d17c7b4e8c52317bdc874917387b7a49f6cf8b01.zip |
Fix shared imports
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/blacklist.ts | 3 | ||||
-rw-r--r-- | server/controllers/api/videos/import.ts | 7 | ||||
-rw-r--r-- | server/controllers/api/videos/live.ts | 3 | ||||
-rw-r--r-- | server/controllers/api/videos/rate.ts | 3 | ||||
-rw-r--r-- | server/controllers/api/videos/update.ts | 3 | ||||
-rw-r--r-- | server/controllers/api/videos/upload.ts | 3 | ||||
-rw-r--r-- | server/controllers/api/videos/watching.ts | 3 |
7 files changed, 9 insertions, 16 deletions
diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts index de65c74f1..4103bb063 100644 --- a/server/controllers/api/videos/blacklist.ts +++ b/server/controllers/api/videos/blacklist.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist' | 2 | import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist' |
3 | import { UserRight, VideoBlacklistCreate } from '../../../../shared' | 3 | import { HttpStatusCode, UserRight, VideoBlacklistCreate } from '@shared/models' |
4 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
5 | import { logger } from '../../../helpers/logger' | 4 | import { logger } from '../../../helpers/logger' |
6 | import { getFormattedObjects } from '../../../helpers/utils' | 5 | import { getFormattedObjects } from '../../../helpers/utils' |
7 | import { sequelizeTypescript } from '../../../initializers/database' | 6 | import { sequelizeTypescript } from '../../../initializers/database' |
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 3c445efce..08d69827b 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -4,6 +4,7 @@ import { decode } from 'magnet-uri' | |||
4 | import parseTorrent, { Instance } from 'parse-torrent' | 4 | import parseTorrent, { Instance } from 'parse-torrent' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { isVideoFileExtnameValid } from '@server/helpers/custom-validators/videos' | 6 | import { isVideoFileExtnameValid } from '@server/helpers/custom-validators/videos' |
7 | import { Hooks } from '@server/lib/plugins/hooks' | ||
7 | import { ServerConfigManager } from '@server/lib/server-config-manager' | 8 | import { ServerConfigManager } from '@server/lib/server-config-manager' |
8 | import { setVideoTags } from '@server/lib/video' | 9 | import { setVideoTags } from '@server/lib/video' |
9 | import { FilteredModelAttributes } from '@server/types' | 10 | import { FilteredModelAttributes } from '@server/types' |
@@ -18,15 +19,14 @@ import { | |||
18 | MVideoWithBlacklistLight | 19 | MVideoWithBlacklistLight |
19 | } from '@server/types/models' | 20 | } from '@server/types/models' |
20 | import { MVideoImportFormattable } from '@server/types/models/video/video-import' | 21 | import { MVideoImportFormattable } from '@server/types/models/video/video-import' |
21 | import { ServerErrorCode, VideoImportCreate, VideoImportState, VideoPrivacy, VideoState } from '../../../../shared' | 22 | import { ServerErrorCode, ThumbnailType, VideoImportCreate, VideoImportState, VideoPrivacy, VideoState } from '@shared/models' |
22 | import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type' | ||
23 | import { auditLoggerFactory, getAuditIdFromRes, VideoImportAuditView } from '../../../helpers/audit-logger' | 23 | import { auditLoggerFactory, getAuditIdFromRes, VideoImportAuditView } from '../../../helpers/audit-logger' |
24 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' | 24 | import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' |
25 | import { isArray } from '../../../helpers/custom-validators/misc' | 25 | import { isArray } from '../../../helpers/custom-validators/misc' |
26 | import { cleanUpReqFiles, createReqFiles } from '../../../helpers/express-utils' | 26 | import { cleanUpReqFiles, createReqFiles } from '../../../helpers/express-utils' |
27 | import { logger } from '../../../helpers/logger' | 27 | import { logger } from '../../../helpers/logger' |
28 | import { getSecureTorrentName } from '../../../helpers/utils' | 28 | import { getSecureTorrentName } from '../../../helpers/utils' |
29 | import { YoutubeDLWrapper, YoutubeDLInfo } from '../../../helpers/youtube-dl' | 29 | import { YoutubeDLInfo, YoutubeDLWrapper } from '../../../helpers/youtube-dl' |
30 | import { CONFIG } from '../../../initializers/config' | 30 | import { CONFIG } from '../../../initializers/config' |
31 | import { MIMETYPES } from '../../../initializers/constants' | 31 | import { MIMETYPES } from '../../../initializers/constants' |
32 | import { sequelizeTypescript } from '../../../initializers/database' | 32 | import { sequelizeTypescript } from '../../../initializers/database' |
@@ -38,7 +38,6 @@ import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoIm | |||
38 | import { VideoModel } from '../../../models/video/video' | 38 | import { VideoModel } from '../../../models/video/video' |
39 | import { VideoCaptionModel } from '../../../models/video/video-caption' | 39 | import { VideoCaptionModel } from '../../../models/video/video-caption' |
40 | import { VideoImportModel } from '../../../models/video/video-import' | 40 | import { VideoImportModel } from '../../../models/video/video-import' |
41 | import { Hooks } from '@server/lib/plugins/hooks' | ||
42 | 41 | ||
43 | const auditLogger = auditLoggerFactory('video-imports') | 42 | const auditLogger = auditLoggerFactory('video-imports') |
44 | const videoImportsRouter = express.Router() | 43 | const videoImportsRouter = express.Router() |
diff --git a/server/controllers/api/videos/live.ts b/server/controllers/api/videos/live.ts index 4ee39aa4f..80ecbfef1 100644 --- a/server/controllers/api/videos/live.ts +++ b/server/controllers/api/videos/live.ts | |||
@@ -10,8 +10,7 @@ import { videoLiveAddValidator, videoLiveGetValidator, videoLiveUpdateValidator | |||
10 | import { VideoLiveModel } from '@server/models/video/video-live' | 10 | import { VideoLiveModel } from '@server/models/video/video-live' |
11 | import { MVideoDetails, MVideoFullLight } from '@server/types/models' | 11 | import { MVideoDetails, MVideoFullLight } from '@server/types/models' |
12 | import { buildUUID, uuidToShort } from '@shared/core-utils' | 12 | import { buildUUID, uuidToShort } from '@shared/core-utils' |
13 | import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared' | 13 | import { HttpStatusCode, LiveVideoCreate, LiveVideoUpdate, VideoState } from '@shared/models' |
14 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
15 | import { logger } from '../../../helpers/logger' | 14 | import { logger } from '../../../helpers/logger' |
16 | import { sequelizeTypescript } from '../../../initializers/database' | 15 | import { sequelizeTypescript } from '../../../initializers/database' |
17 | import { updateVideoMiniatureFromExisting } from '../../../lib/thumbnail' | 16 | import { updateVideoMiniatureFromExisting } from '../../../lib/thumbnail' |
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts index c9cc16644..6b26a8eee 100644 --- a/server/controllers/api/videos/rate.ts +++ b/server/controllers/api/videos/rate.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { UserVideoRateUpdate } from '../../../../shared' | 2 | import { HttpStatusCode, UserVideoRateUpdate } from '@shared/models' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
4 | import { logger } from '../../../helpers/logger' | 3 | import { logger } from '../../../helpers/logger' |
5 | import { VIDEO_RATE_TYPES } from '../../../initializers/constants' | 4 | import { VIDEO_RATE_TYPES } from '../../../initializers/constants' |
6 | import { sequelizeTypescript } from '../../../initializers/database' | 5 | import { sequelizeTypescript } from '../../../initializers/database' |
diff --git a/server/controllers/api/videos/update.ts b/server/controllers/api/videos/update.ts index 589556f47..f600847d4 100644 --- a/server/controllers/api/videos/update.ts +++ b/server/controllers/api/videos/update.ts | |||
@@ -6,8 +6,7 @@ import { buildVideoThumbnailsFromReq, setVideoTags } from '@server/lib/video' | |||
6 | import { openapiOperationDoc } from '@server/middlewares/doc' | 6 | import { openapiOperationDoc } from '@server/middlewares/doc' |
7 | import { FilteredModelAttributes } from '@server/types' | 7 | import { FilteredModelAttributes } from '@server/types' |
8 | import { MVideoFullLight } from '@server/types/models' | 8 | import { MVideoFullLight } from '@server/types/models' |
9 | import { VideoUpdate } from '../../../../shared' | 9 | import { HttpStatusCode, VideoUpdate } from '@shared/models' |
10 | import { HttpStatusCode } from '../../../../shared/models' | ||
11 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' | 10 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' |
12 | import { resetSequelizeInstance } from '../../../helpers/database-utils' | 11 | import { resetSequelizeInstance } from '../../../helpers/database-utils' |
13 | import { createReqFiles } from '../../../helpers/express-utils' | 12 | import { createReqFiles } from '../../../helpers/express-utils' |
diff --git a/server/controllers/api/videos/upload.ts b/server/controllers/api/videos/upload.ts index ecc4dfa37..e8f400cff 100644 --- a/server/controllers/api/videos/upload.ts +++ b/server/controllers/api/videos/upload.ts | |||
@@ -20,8 +20,7 @@ import { openapiOperationDoc } from '@server/middlewares/doc' | |||
20 | import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' | 20 | import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' |
21 | import { getLowercaseExtension, uuidToShort } from '@shared/core-utils' | 21 | import { getLowercaseExtension, uuidToShort } from '@shared/core-utils' |
22 | import { isAudioFile } from '@shared/extra-utils' | 22 | import { isAudioFile } from '@shared/extra-utils' |
23 | import { VideoCreate, VideoState } from '../../../../shared' | 23 | import { HttpStatusCode, VideoCreate, VideoResolution, VideoState } from '@shared/models' |
24 | import { HttpStatusCode, VideoResolution } from '../../../../shared/models' | ||
25 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' | 24 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' |
26 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 25 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
27 | import { createReqFiles } from '../../../helpers/express-utils' | 26 | import { createReqFiles } from '../../../helpers/express-utils' |
diff --git a/server/controllers/api/videos/watching.ts b/server/controllers/api/videos/watching.ts index e8c28b613..3fd22caac 100644 --- a/server/controllers/api/videos/watching.ts +++ b/server/controllers/api/videos/watching.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { UserWatchingVideo } from '../../../../shared' | 2 | import { HttpStatusCode, UserWatchingVideo } from '@shared/models' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
4 | import { | 3 | import { |
5 | asyncMiddleware, | 4 | asyncMiddleware, |
6 | asyncRetryTransactionMiddleware, | 5 | asyncRetryTransactionMiddleware, |