aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-24 10:14:47 +0100
committerChocobozzz <me@florianbigard.com>2021-12-24 10:14:47 +0100
commitd17c7b4e8c52317bdc874917387b7a49f6cf8b01 (patch)
tree83a736f566f8cb4c696fa8e59086a523bbb4b4bf /server/controllers/api/videos
parent1e9c1b1b44b4cbd4bc4b1e97e8e6ba2df93371de (diff)
downloadPeerTube-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.ts3
-rw-r--r--server/controllers/api/videos/import.ts7
-rw-r--r--server/controllers/api/videos/live.ts3
-rw-r--r--server/controllers/api/videos/rate.ts3
-rw-r--r--server/controllers/api/videos/update.ts3
-rw-r--r--server/controllers/api/videos/upload.ts3
-rw-r--r--server/controllers/api/videos/watching.ts3
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 @@
1import express from 'express' 1import express from 'express'
2import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist' 2import { blacklistVideo, unblacklistVideo } from '@server/lib/video-blacklist'
3import { UserRight, VideoBlacklistCreate } from '../../../../shared' 3import { HttpStatusCode, UserRight, VideoBlacklistCreate } from '@shared/models'
4import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
5import { logger } from '../../../helpers/logger' 4import { logger } from '../../../helpers/logger'
6import { getFormattedObjects } from '../../../helpers/utils' 5import { getFormattedObjects } from '../../../helpers/utils'
7import { sequelizeTypescript } from '../../../initializers/database' 6import { 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'
4import parseTorrent, { Instance } from 'parse-torrent' 4import parseTorrent, { Instance } from 'parse-torrent'
5import { join } from 'path' 5import { join } from 'path'
6import { isVideoFileExtnameValid } from '@server/helpers/custom-validators/videos' 6import { isVideoFileExtnameValid } from '@server/helpers/custom-validators/videos'
7import { Hooks } from '@server/lib/plugins/hooks'
7import { ServerConfigManager } from '@server/lib/server-config-manager' 8import { ServerConfigManager } from '@server/lib/server-config-manager'
8import { setVideoTags } from '@server/lib/video' 9import { setVideoTags } from '@server/lib/video'
9import { FilteredModelAttributes } from '@server/types' 10import { FilteredModelAttributes } from '@server/types'
@@ -18,15 +19,14 @@ import {
18 MVideoWithBlacklistLight 19 MVideoWithBlacklistLight
19} from '@server/types/models' 20} from '@server/types/models'
20import { MVideoImportFormattable } from '@server/types/models/video/video-import' 21import { MVideoImportFormattable } from '@server/types/models/video/video-import'
21import { ServerErrorCode, VideoImportCreate, VideoImportState, VideoPrivacy, VideoState } from '../../../../shared' 22import { ServerErrorCode, ThumbnailType, VideoImportCreate, VideoImportState, VideoPrivacy, VideoState } from '@shared/models'
22import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type'
23import { auditLoggerFactory, getAuditIdFromRes, VideoImportAuditView } from '../../../helpers/audit-logger' 23import { auditLoggerFactory, getAuditIdFromRes, VideoImportAuditView } from '../../../helpers/audit-logger'
24import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils' 24import { moveAndProcessCaptionFile } from '../../../helpers/captions-utils'
25import { isArray } from '../../../helpers/custom-validators/misc' 25import { isArray } from '../../../helpers/custom-validators/misc'
26import { cleanUpReqFiles, createReqFiles } from '../../../helpers/express-utils' 26import { cleanUpReqFiles, createReqFiles } from '../../../helpers/express-utils'
27import { logger } from '../../../helpers/logger' 27import { logger } from '../../../helpers/logger'
28import { getSecureTorrentName } from '../../../helpers/utils' 28import { getSecureTorrentName } from '../../../helpers/utils'
29import { YoutubeDLWrapper, YoutubeDLInfo } from '../../../helpers/youtube-dl' 29import { YoutubeDLInfo, YoutubeDLWrapper } from '../../../helpers/youtube-dl'
30import { CONFIG } from '../../../initializers/config' 30import { CONFIG } from '../../../initializers/config'
31import { MIMETYPES } from '../../../initializers/constants' 31import { MIMETYPES } from '../../../initializers/constants'
32import { sequelizeTypescript } from '../../../initializers/database' 32import { sequelizeTypescript } from '../../../initializers/database'
@@ -38,7 +38,6 @@ import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoIm
38import { VideoModel } from '../../../models/video/video' 38import { VideoModel } from '../../../models/video/video'
39import { VideoCaptionModel } from '../../../models/video/video-caption' 39import { VideoCaptionModel } from '../../../models/video/video-caption'
40import { VideoImportModel } from '../../../models/video/video-import' 40import { VideoImportModel } from '../../../models/video/video-import'
41import { Hooks } from '@server/lib/plugins/hooks'
42 41
43const auditLogger = auditLoggerFactory('video-imports') 42const auditLogger = auditLoggerFactory('video-imports')
44const videoImportsRouter = express.Router() 43const 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
10import { VideoLiveModel } from '@server/models/video/video-live' 10import { VideoLiveModel } from '@server/models/video/video-live'
11import { MVideoDetails, MVideoFullLight } from '@server/types/models' 11import { MVideoDetails, MVideoFullLight } from '@server/types/models'
12import { buildUUID, uuidToShort } from '@shared/core-utils' 12import { buildUUID, uuidToShort } from '@shared/core-utils'
13import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared' 13import { HttpStatusCode, LiveVideoCreate, LiveVideoUpdate, VideoState } from '@shared/models'
14import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
15import { logger } from '../../../helpers/logger' 14import { logger } from '../../../helpers/logger'
16import { sequelizeTypescript } from '../../../initializers/database' 15import { sequelizeTypescript } from '../../../initializers/database'
17import { updateVideoMiniatureFromExisting } from '../../../lib/thumbnail' 16import { 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 @@
1import express from 'express' 1import express from 'express'
2import { UserVideoRateUpdate } from '../../../../shared' 2import { HttpStatusCode, UserVideoRateUpdate } from '@shared/models'
3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
4import { logger } from '../../../helpers/logger' 3import { logger } from '../../../helpers/logger'
5import { VIDEO_RATE_TYPES } from '../../../initializers/constants' 4import { VIDEO_RATE_TYPES } from '../../../initializers/constants'
6import { sequelizeTypescript } from '../../../initializers/database' 5import { 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'
6import { openapiOperationDoc } from '@server/middlewares/doc' 6import { openapiOperationDoc } from '@server/middlewares/doc'
7import { FilteredModelAttributes } from '@server/types' 7import { FilteredModelAttributes } from '@server/types'
8import { MVideoFullLight } from '@server/types/models' 8import { MVideoFullLight } from '@server/types/models'
9import { VideoUpdate } from '../../../../shared' 9import { HttpStatusCode, VideoUpdate } from '@shared/models'
10import { HttpStatusCode } from '../../../../shared/models'
11import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' 10import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger'
12import { resetSequelizeInstance } from '../../../helpers/database-utils' 11import { resetSequelizeInstance } from '../../../helpers/database-utils'
13import { createReqFiles } from '../../../helpers/express-utils' 12import { 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'
20import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' 20import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models'
21import { getLowercaseExtension, uuidToShort } from '@shared/core-utils' 21import { getLowercaseExtension, uuidToShort } from '@shared/core-utils'
22import { isAudioFile } from '@shared/extra-utils' 22import { isAudioFile } from '@shared/extra-utils'
23import { VideoCreate, VideoState } from '../../../../shared' 23import { HttpStatusCode, VideoCreate, VideoResolution, VideoState } from '@shared/models'
24import { HttpStatusCode, VideoResolution } from '../../../../shared/models'
25import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' 24import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger'
26import { retryTransactionWrapper } from '../../../helpers/database-utils' 25import { retryTransactionWrapper } from '../../../helpers/database-utils'
27import { createReqFiles } from '../../../helpers/express-utils' 26import { 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 @@
1import express from 'express' 1import express from 'express'
2import { UserWatchingVideo } from '../../../../shared' 2import { HttpStatusCode, UserWatchingVideo } from '@shared/models'
3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
4import { 3import {
5 asyncMiddleware, 4 asyncMiddleware,
6 asyncRetryTransactionMiddleware, 5 asyncRetryTransactionMiddleware,