aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 14:27:30 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:19 +0200
commit4c7e60bc17ee5830399bac4aa273356903421b4c (patch)
tree9e67397cf49b229b5bc0f9747f1a7e387bba558a /server/controllers
parentc0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea (diff)
downloadPeerTube-4c7e60bc17ee5830399bac4aa273356903421b4c.tar.gz
PeerTube-4c7e60bc17ee5830399bac4aa273356903421b4c.tar.zst
PeerTube-4c7e60bc17ee5830399bac4aa273356903421b4c.zip
Reorganize imports
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/bulk.ts6
-rw-r--r--server/controllers/api/config.ts2
-rw-r--r--server/controllers/api/custom-page.ts3
-rw-r--r--server/controllers/api/overviews.ts10
-rw-r--r--server/controllers/api/plugins.ts2
-rw-r--r--server/controllers/api/search/search-video-channels.ts3
-rw-r--r--server/controllers/api/search/search-video-playlists.ts5
-rw-r--r--server/controllers/api/search/search-videos.ts3
-rw-r--r--server/controllers/api/server/contact.ts8
-rw-r--r--server/controllers/api/server/index.ts8
-rw-r--r--server/controllers/api/server/logs.ts12
-rw-r--r--server/controllers/api/users/me.ts2
-rw-r--r--server/controllers/api/users/my-blocklist.ts10
-rw-r--r--server/controllers/api/users/my-history.ts6
-rw-r--r--server/controllers/api/users/my-video-playlists.ts2
-rw-r--r--server/controllers/api/videos/blacklist.ts2
-rw-r--r--server/controllers/api/videos/comment.ts2
-rw-r--r--server/controllers/api/videos/ownership.ts14
-rw-r--r--server/controllers/api/videos/rate.ts4
-rw-r--r--server/controllers/api/videos/watching.ts2
-rw-r--r--server/controllers/download.ts3
21 files changed, 52 insertions, 57 deletions
diff --git a/server/controllers/api/bulk.ts b/server/controllers/api/bulk.ts
index 10d83571d..62121ece5 100644
--- a/server/controllers/api/bulk.ts
+++ b/server/controllers/api/bulk.ts
@@ -1,10 +1,10 @@
1import * as express from 'express' 1import * as express from 'express'
2import { asyncMiddleware, authenticate } from '../../middlewares' 2import { removeComment } from '@server/lib/video-comment'
3import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk' 3import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk'
4import { VideoCommentModel } from '@server/models/video/video-comment' 4import { VideoCommentModel } from '@server/models/video/video-comment'
5import { removeComment } from '@server/lib/video-comment'
6import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model'
7import { HttpStatusCode } from '@shared/models' 5import { HttpStatusCode } from '@shared/models'
6import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model'
7import { asyncMiddleware, authenticate } from '../../middlewares'
8 8
9const bulkRouter = express.Router() 9const bulkRouter = express.Router()
10 10
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index 9bd8c21c5..ee733a38c 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -1,8 +1,8 @@
1import { ServerConfigManager } from '@server/lib/server-config-manager'
2import * as express from 'express' 1import * as express from 'express'
3import { remove, writeJSON } from 'fs-extra' 2import { remove, writeJSON } from 'fs-extra'
4import { snakeCase } from 'lodash' 3import { snakeCase } from 'lodash'
5import validator from 'validator' 4import validator from 'validator'
5import { ServerConfigManager } from '@server/lib/server-config-manager'
6import { UserRight } from '../../../shared' 6import { UserRight } from '../../../shared'
7import { About } from '../../../shared/models/server/about.model' 7import { About } from '../../../shared/models/server/about.model'
8import { CustomConfig } from '../../../shared/models/server/custom-config.model' 8import { CustomConfig } from '../../../shared/models/server/custom-config.model'
diff --git a/server/controllers/api/custom-page.ts b/server/controllers/api/custom-page.ts
index cc1aa8427..68d8c2ea4 100644
--- a/server/controllers/api/custom-page.ts
+++ b/server/controllers/api/custom-page.ts
@@ -1,8 +1,7 @@
1import * as express from 'express' 1import * as express from 'express'
2import { ServerConfigManager } from '@server/lib/server-config-manager' 2import { ServerConfigManager } from '@server/lib/server-config-manager'
3import { ActorCustomPageModel } from '@server/models/account/actor-custom-page' 3import { ActorCustomPageModel } from '@server/models/account/actor-custom-page'
4import { HttpStatusCode } from '@shared/models' 4import { HttpStatusCode, UserRight } from '@shared/models'
5import { UserRight } from '@shared/models'
6import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' 5import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares'
7 6
8const customPageRouter = express.Router() 7const customPageRouter = express.Router()
diff --git a/server/controllers/api/overviews.ts b/server/controllers/api/overviews.ts
index ad879aad6..aaa341d54 100644
--- a/server/controllers/api/overviews.ts
+++ b/server/controllers/api/overviews.ts
@@ -1,12 +1,12 @@
1import * as express from 'express' 1import * as express from 'express'
2import * as memoizee from 'memoizee'
3import { logger } from '@server/helpers/logger'
4import { CategoryOverview, ChannelOverview, TagOverview, VideosOverview } from '../../../shared/models/overviews'
2import { buildNSFWFilter } from '../../helpers/express-utils' 5import { buildNSFWFilter } from '../../helpers/express-utils'
3import { VideoModel } from '../../models/video/video' 6import { MEMOIZE_TTL, OVERVIEWS } from '../../initializers/constants'
4import { asyncMiddleware, optionalAuthenticate, videosOverviewValidator } from '../../middlewares' 7import { asyncMiddleware, optionalAuthenticate, videosOverviewValidator } from '../../middlewares'
5import { TagModel } from '../../models/video/tag' 8import { TagModel } from '../../models/video/tag'
6import { CategoryOverview, ChannelOverview, TagOverview, VideosOverview } from '../../../shared/models/overviews' 9import { VideoModel } from '../../models/video/video'
7import { MEMOIZE_TTL, OVERVIEWS } from '../../initializers/constants'
8import * as memoizee from 'memoizee'
9import { logger } from '@server/helpers/logger'
10 10
11const overviewsRouter = express.Router() 11const overviewsRouter = express.Router()
12 12
diff --git a/server/controllers/api/plugins.ts b/server/controllers/api/plugins.ts
index 4b213c246..3a9ef34e8 100644
--- a/server/controllers/api/plugins.ts
+++ b/server/controllers/api/plugins.ts
@@ -23,8 +23,8 @@ import {
23 updatePluginSettingsValidator 23 updatePluginSettingsValidator
24} from '@server/middlewares/validators/plugins' 24} from '@server/middlewares/validators/plugins'
25import { PluginModel } from '@server/models/server/plugin' 25import { PluginModel } from '@server/models/server/plugin'
26import { HttpStatusCode } from '@shared/models'
27import { 26import {
27 HttpStatusCode,
28 InstallOrUpdatePlugin, 28 InstallOrUpdatePlugin,
29 ManagePlugin, 29 ManagePlugin,
30 PeertubePluginIndexList, 30 PeertubePluginIndexList,
diff --git a/server/controllers/api/search/search-video-channels.ts b/server/controllers/api/search/search-video-channels.ts
index fe9178e69..c8f0a0a0b 100644
--- a/server/controllers/api/search/search-video-channels.ts
+++ b/server/controllers/api/search/search-video-channels.ts
@@ -6,8 +6,7 @@ import { WEBSERVER } from '@server/initializers/constants'
6import { Hooks } from '@server/lib/plugins/hooks' 6import { Hooks } from '@server/lib/plugins/hooks'
7import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' 7import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search'
8import { getServerActor } from '@server/models/application/application' 8import { getServerActor } from '@server/models/application/application'
9import { HttpStatusCode } from '@shared/models' 9import { HttpStatusCode, ResultList, VideoChannel } from '@shared/models'
10import { ResultList, VideoChannel } from '@shared/models'
11import { VideoChannelsSearchQuery } from '../../../../shared/models/search' 10import { VideoChannelsSearchQuery } from '../../../../shared/models/search'
12import { isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils' 11import { isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils'
13import { logger } from '../../../helpers/logger' 12import { logger } from '../../../helpers/logger'
diff --git a/server/controllers/api/search/search-video-playlists.ts b/server/controllers/api/search/search-video-playlists.ts
index a0e2c1747..f55b1fba3 100644
--- a/server/controllers/api/search/search-video-playlists.ts
+++ b/server/controllers/api/search/search-video-playlists.ts
@@ -5,14 +5,14 @@ import { logger } from '@server/helpers/logger'
5import { doJSONRequest } from '@server/helpers/requests' 5import { doJSONRequest } from '@server/helpers/requests'
6import { getFormattedObjects } from '@server/helpers/utils' 6import { getFormattedObjects } from '@server/helpers/utils'
7import { CONFIG } from '@server/initializers/config' 7import { CONFIG } from '@server/initializers/config'
8import { WEBSERVER } from '@server/initializers/constants'
8import { getOrCreateAPVideoPlaylist } from '@server/lib/activitypub/playlists/get' 9import { getOrCreateAPVideoPlaylist } from '@server/lib/activitypub/playlists/get'
9import { Hooks } from '@server/lib/plugins/hooks' 10import { Hooks } from '@server/lib/plugins/hooks'
10import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' 11import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search'
11import { getServerActor } from '@server/models/application/application' 12import { getServerActor } from '@server/models/application/application'
12import { VideoPlaylistModel } from '@server/models/video/video-playlist' 13import { VideoPlaylistModel } from '@server/models/video/video-playlist'
13import { MVideoPlaylistFullSummary } from '@server/types/models' 14import { MVideoPlaylistFullSummary } from '@server/types/models'
14import { HttpStatusCode } from '@shared/models' 15import { HttpStatusCode, ResultList, VideoPlaylist, VideoPlaylistsSearchQuery } from '@shared/models'
15import { ResultList, VideoPlaylist, VideoPlaylistsSearchQuery } from '@shared/models'
16import { 16import {
17 asyncMiddleware, 17 asyncMiddleware,
18 openapiOperationDoc, 18 openapiOperationDoc,
@@ -23,7 +23,6 @@ import {
23 videoPlaylistsListSearchValidator, 23 videoPlaylistsListSearchValidator,
24 videoPlaylistsSearchSortValidator 24 videoPlaylistsSearchSortValidator
25} from '../../../middlewares' 25} from '../../../middlewares'
26import { WEBSERVER } from '@server/initializers/constants'
27 26
28const searchPlaylistsRouter = express.Router() 27const searchPlaylistsRouter = express.Router()
29 28
diff --git a/server/controllers/api/search/search-videos.ts b/server/controllers/api/search/search-videos.ts
index 0e6fd9c72..a4153f3f8 100644
--- a/server/controllers/api/search/search-videos.ts
+++ b/server/controllers/api/search/search-videos.ts
@@ -6,8 +6,7 @@ import { WEBSERVER } from '@server/initializers/constants'
6import { getOrCreateAPVideo } from '@server/lib/activitypub/videos' 6import { getOrCreateAPVideo } from '@server/lib/activitypub/videos'
7import { Hooks } from '@server/lib/plugins/hooks' 7import { Hooks } from '@server/lib/plugins/hooks'
8import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' 8import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search'
9import { HttpStatusCode } from '@shared/models' 9import { HttpStatusCode, ResultList, Video } from '@shared/models'
10import { ResultList, Video } from '@shared/models'
11import { VideosSearchQuery } from '../../../../shared/models/search' 10import { VideosSearchQuery } from '../../../../shared/models/search'
12import { buildNSFWFilter, isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils' 11import { buildNSFWFilter, isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils'
13import { logger } from '../../../helpers/logger' 12import { logger } from '../../../helpers/logger'
diff --git a/server/controllers/api/server/contact.ts b/server/controllers/api/server/contact.ts
index ae36dd599..b315e99cf 100644
--- a/server/controllers/api/server/contact.ts
+++ b/server/controllers/api/server/contact.ts
@@ -1,9 +1,9 @@
1import * as express from 'express' 1import * as express from 'express'
2import { asyncMiddleware, contactAdministratorValidator } from '../../../middlewares'
3import { Redis } from '../../../lib/redis'
4import { Emailer } from '../../../lib/emailer'
5import { ContactForm } from '../../../../shared/models/server'
6import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' 2import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
3import { ContactForm } from '../../../../shared/models/server'
4import { Emailer } from '../../../lib/emailer'
5import { Redis } from '../../../lib/redis'
6import { asyncMiddleware, contactAdministratorValidator } from '../../../middlewares'
7 7
8const contactRouter = express.Router() 8const contactRouter = express.Router()
9 9
diff --git a/server/controllers/api/server/index.ts b/server/controllers/api/server/index.ts
index 6b8793a19..32fefefc0 100644
--- a/server/controllers/api/server/index.ts
+++ b/server/controllers/api/server/index.ts
@@ -1,11 +1,11 @@
1import * as express from 'express' 1import * as express from 'express'
2import { contactRouter } from './contact'
3import { debugRouter } from './debug'
2import { serverFollowsRouter } from './follows' 4import { serverFollowsRouter } from './follows'
3import { statsRouter } from './stats' 5import { logsRouter } from './logs'
4import { serverRedundancyRouter } from './redundancy' 6import { serverRedundancyRouter } from './redundancy'
5import { serverBlocklistRouter } from './server-blocklist' 7import { serverBlocklistRouter } from './server-blocklist'
6import { contactRouter } from './contact' 8import { statsRouter } from './stats'
7import { logsRouter } from './logs'
8import { debugRouter } from './debug'
9 9
10const serverRouter = express.Router() 10const serverRouter = express.Router()
11 11
diff --git a/server/controllers/api/server/logs.ts b/server/controllers/api/server/logs.ts
index 4b543d686..f78607d35 100644
--- a/server/controllers/api/server/logs.ts
+++ b/server/controllers/api/server/logs.ts
@@ -1,14 +1,14 @@
1import * as express from 'express' 1import * as express from 'express'
2import { UserRight } from '../../../../shared/models/users'
3import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../../middlewares'
4import { mtimeSortFilesDesc } from '../../../../shared/core-utils/logs/logs'
5import { readdir, readFile } from 'fs-extra' 2import { readdir, readFile } from 'fs-extra'
6import { AUDIT_LOG_FILENAME, MAX_LOGS_OUTPUT_CHARACTERS, LOG_FILENAME } from '../../../initializers/constants'
7import { join } from 'path' 3import { join } from 'path'
8import { getAuditLogsValidator, getLogsValidator } from '../../../middlewares/validators/logs' 4import { logger } from '@server/helpers/logger'
5import { mtimeSortFilesDesc } from '../../../../shared/core-utils/logs/logs'
9import { LogLevel } from '../../../../shared/models/server/log-level.type' 6import { LogLevel } from '../../../../shared/models/server/log-level.type'
7import { UserRight } from '../../../../shared/models/users'
10import { CONFIG } from '../../../initializers/config' 8import { CONFIG } from '../../../initializers/config'
11import { logger } from '@server/helpers/logger' 9import { AUDIT_LOG_FILENAME, LOG_FILENAME, MAX_LOGS_OUTPUT_CHARACTERS } from '../../../initializers/constants'
10import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../../middlewares'
11import { getAuditLogsValidator, getLogsValidator } from '../../../middlewares/validators/logs'
12 12
13const logsRouter = express.Router() 13const logsRouter = express.Router()
14 14
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts
index c9610c59f..ac6faca9c 100644
--- a/server/controllers/api/users/me.ts
+++ b/server/controllers/api/users/me.ts
@@ -2,6 +2,7 @@ import 'multer'
2import * as express from 'express' 2import * as express from 'express'
3import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger' 3import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger'
4import { Hooks } from '@server/lib/plugins/hooks' 4import { Hooks } from '@server/lib/plugins/hooks'
5import { AttributesOnly } from '@shared/core-utils'
5import { ActorImageType, UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared' 6import { ActorImageType, UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared'
6import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' 7import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
7import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model' 8import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model'
@@ -31,7 +32,6 @@ import { AccountVideoRateModel } from '../../../models/account/account-video-rat
31import { UserModel } from '../../../models/user/user' 32import { UserModel } from '../../../models/user/user'
32import { VideoModel } from '../../../models/video/video' 33import { VideoModel } from '../../../models/video/video'
33import { VideoImportModel } from '../../../models/video/video-import' 34import { VideoImportModel } from '../../../models/video/video-import'
34import { AttributesOnly } from '@shared/core-utils'
35 35
36const auditLogger = auditLoggerFactory('users') 36const auditLogger = auditLoggerFactory('users')
37 37
diff --git a/server/controllers/api/users/my-blocklist.ts b/server/controllers/api/users/my-blocklist.ts
index fe11b6e77..24fff83e3 100644
--- a/server/controllers/api/users/my-blocklist.ts
+++ b/server/controllers/api/users/my-blocklist.ts
@@ -1,6 +1,10 @@
1import * as express from 'express'
2import 'multer' 1import 'multer'
2import * as express from 'express'
3import { logger } from '@server/helpers/logger'
4import { UserNotificationModel } from '@server/models/user/user-notification'
5import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
3import { getFormattedObjects } from '../../../helpers/utils' 6import { getFormattedObjects } from '../../../helpers/utils'
7import { addAccountInBlocklist, addServerInBlocklist, removeAccountFromBlocklist, removeServerFromBlocklist } from '../../../lib/blocklist'
4import { 8import {
5 asyncMiddleware, 9 asyncMiddleware,
6 asyncRetryTransactionMiddleware, 10 asyncRetryTransactionMiddleware,
@@ -18,11 +22,7 @@ import {
18 unblockServerByAccountValidator 22 unblockServerByAccountValidator
19} from '../../../middlewares/validators' 23} from '../../../middlewares/validators'
20import { AccountBlocklistModel } from '../../../models/account/account-blocklist' 24import { AccountBlocklistModel } from '../../../models/account/account-blocklist'
21import { addAccountInBlocklist, addServerInBlocklist, removeAccountFromBlocklist, removeServerFromBlocklist } from '../../../lib/blocklist'
22import { ServerBlocklistModel } from '../../../models/server/server-blocklist' 25import { ServerBlocklistModel } from '../../../models/server/server-blocklist'
23import { UserNotificationModel } from '@server/models/user/user-notification'
24import { logger } from '@server/helpers/logger'
25import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
26 26
27const myBlocklistRouter = express.Router() 27const myBlocklistRouter = express.Router()
28 28
diff --git a/server/controllers/api/users/my-history.ts b/server/controllers/api/users/my-history.ts
index 85e04925e..a6e723103 100644
--- a/server/controllers/api/users/my-history.ts
+++ b/server/controllers/api/users/my-history.ts
@@ -1,4 +1,7 @@
1import * as express from 'express' 1import * as express from 'express'
2import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
3import { getFormattedObjects } from '../../../helpers/utils'
4import { sequelizeTypescript } from '../../../initializers/database'
2import { 5import {
3 asyncMiddleware, 6 asyncMiddleware,
4 asyncRetryTransactionMiddleware, 7 asyncRetryTransactionMiddleware,
@@ -8,10 +11,7 @@ import {
8 userHistoryListValidator, 11 userHistoryListValidator,
9 userHistoryRemoveValidator 12 userHistoryRemoveValidator
10} from '../../../middlewares' 13} from '../../../middlewares'
11import { getFormattedObjects } from '../../../helpers/utils'
12import { UserVideoHistoryModel } from '../../../models/user/user-video-history' 14import { UserVideoHistoryModel } from '../../../models/user/user-video-history'
13import { sequelizeTypescript } from '../../../initializers/database'
14import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
15 15
16const myVideosHistoryRouter = express.Router() 16const myVideosHistoryRouter = express.Router()
17 17
diff --git a/server/controllers/api/users/my-video-playlists.ts b/server/controllers/api/users/my-video-playlists.ts
index d0bd99463..76e741ba5 100644
--- a/server/controllers/api/users/my-video-playlists.ts
+++ b/server/controllers/api/users/my-video-playlists.ts
@@ -1,8 +1,8 @@
1import * as express from 'express' 1import * as express from 'express'
2import { VideosExistInPlaylists } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model'
2import { asyncMiddleware, authenticate } from '../../../middlewares' 3import { asyncMiddleware, authenticate } from '../../../middlewares'
3import { doVideosInPlaylistExistValidator } from '../../../middlewares/validators/videos/video-playlists' 4import { doVideosInPlaylistExistValidator } from '../../../middlewares/validators/videos/video-playlists'
4import { VideoPlaylistModel } from '../../../models/video/video-playlist' 5import { VideoPlaylistModel } from '../../../models/video/video-playlist'
5import { VideosExistInPlaylists } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model'
6 6
7const myVideoPlaylistsRouter = express.Router() 7const myVideoPlaylistsRouter = express.Router()
8 8
diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts
index a7f5f53d8..6bc768471 100644
--- a/server/controllers/api/videos/blacklist.ts
+++ b/server/controllers/api/videos/blacklist.ts
@@ -1,6 +1,7 @@
1import * as express from 'express' 1import * as 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 { UserRight, VideoBlacklistCreate } from '../../../../shared'
4import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
4import { logger } from '../../../helpers/logger' 5import { logger } from '../../../helpers/logger'
5import { getFormattedObjects } from '../../../helpers/utils' 6import { getFormattedObjects } from '../../../helpers/utils'
6import { sequelizeTypescript } from '../../../initializers/database' 7import { sequelizeTypescript } from '../../../initializers/database'
@@ -19,7 +20,6 @@ import {
19 videosBlacklistUpdateValidator 20 videosBlacklistUpdateValidator
20} from '../../../middlewares' 21} from '../../../middlewares'
21import { VideoBlacklistModel } from '../../../models/video/video-blacklist' 22import { VideoBlacklistModel } from '../../../models/video/video-blacklist'
22import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
23 23
24const blacklistRouter = express.Router() 24const blacklistRouter = express.Router()
25 25
diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts
index 90b633bb5..cb696f652 100644
--- a/server/controllers/api/videos/comment.ts
+++ b/server/controllers/api/videos/comment.ts
@@ -1,6 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
3import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models' 2import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models'
3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
4import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model' 4import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model'
5import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger' 5import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger'
6import { getFormattedObjects } from '../../../helpers/utils' 6import { getFormattedObjects } from '../../../helpers/utils'
diff --git a/server/controllers/api/videos/ownership.ts b/server/controllers/api/videos/ownership.ts
index e6c94a45a..f48acbc68 100644
--- a/server/controllers/api/videos/ownership.ts
+++ b/server/controllers/api/videos/ownership.ts
@@ -1,6 +1,12 @@
1import * as express from 'express' 1import * as express from 'express'
2import { MVideoFullLight } from '@server/types/models'
3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
4import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos'
2import { logger } from '../../../helpers/logger' 5import { logger } from '../../../helpers/logger'
6import { getFormattedObjects } from '../../../helpers/utils'
3import { sequelizeTypescript } from '../../../initializers/database' 7import { sequelizeTypescript } from '../../../initializers/database'
8import { sendUpdateVideo } from '../../../lib/activitypub/send'
9import { changeVideoChannelShare } from '../../../lib/activitypub/share'
4import { 10import {
5 asyncMiddleware, 11 asyncMiddleware,
6 asyncRetryTransactionMiddleware, 12 asyncRetryTransactionMiddleware,
@@ -11,15 +17,9 @@ import {
11 videosChangeOwnershipValidator, 17 videosChangeOwnershipValidator,
12 videosTerminateChangeOwnershipValidator 18 videosTerminateChangeOwnershipValidator
13} from '../../../middlewares' 19} from '../../../middlewares'
20import { VideoModel } from '../../../models/video/video'
14import { VideoChangeOwnershipModel } from '../../../models/video/video-change-ownership' 21import { VideoChangeOwnershipModel } from '../../../models/video/video-change-ownership'
15import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos'
16import { VideoChannelModel } from '../../../models/video/video-channel' 22import { VideoChannelModel } from '../../../models/video/video-channel'
17import { getFormattedObjects } from '../../../helpers/utils'
18import { changeVideoChannelShare } from '../../../lib/activitypub/share'
19import { sendUpdateVideo } from '../../../lib/activitypub/send'
20import { VideoModel } from '../../../models/video/video'
21import { MVideoFullLight } from '@server/types/models'
22import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
23 23
24const ownershipVideoRouter = express.Router() 24const ownershipVideoRouter = express.Router()
25 25
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts
index 134c9e5ca..96f6cd886 100644
--- a/server/controllers/api/videos/rate.ts
+++ b/server/controllers/api/videos/rate.ts
@@ -1,13 +1,13 @@
1import * as express from 'express' 1import * as express from 'express'
2import { UserVideoRateUpdate } from '../../../../shared' 2import { UserVideoRateUpdate } from '../../../../shared'
3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
3import { logger } from '../../../helpers/logger' 4import { logger } from '../../../helpers/logger'
4import { VIDEO_RATE_TYPES } from '../../../initializers/constants' 5import { VIDEO_RATE_TYPES } from '../../../initializers/constants'
6import { sequelizeTypescript } from '../../../initializers/database'
5import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates' 7import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates'
6import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares' 8import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares'
7import { AccountModel } from '../../../models/account/account' 9import { AccountModel } from '../../../models/account/account'
8import { AccountVideoRateModel } from '../../../models/account/account-video-rate' 10import { AccountVideoRateModel } from '../../../models/account/account-video-rate'
9import { sequelizeTypescript } from '../../../initializers/database'
10import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
11 11
12const rateVideoRouter = express.Router() 12const rateVideoRouter = express.Router()
13 13
diff --git a/server/controllers/api/videos/watching.ts b/server/controllers/api/videos/watching.ts
index 2899dbd9c..05c75e543 100644
--- a/server/controllers/api/videos/watching.ts
+++ b/server/controllers/api/videos/watching.ts
@@ -1,5 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { UserWatchingVideo } from '../../../../shared' 2import { UserWatchingVideo } from '../../../../shared'
3import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
3import { 4import {
4 asyncMiddleware, 5 asyncMiddleware,
5 asyncRetryTransactionMiddleware, 6 asyncRetryTransactionMiddleware,
@@ -8,7 +9,6 @@ import {
8 videoWatchingValidator 9 videoWatchingValidator
9} from '../../../middlewares' 10} from '../../../middlewares'
10import { UserVideoHistoryModel } from '../../../models/user/user-video-history' 11import { UserVideoHistoryModel } from '../../../models/user/user-video-history'
11import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes'
12 12
13const watchingRouter = express.Router() 13const watchingRouter = express.Router()
14 14
diff --git a/server/controllers/download.ts b/server/controllers/download.ts
index 13bc66900..ddacc1b68 100644
--- a/server/controllers/download.ts
+++ b/server/controllers/download.ts
@@ -5,8 +5,7 @@ import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache
5import { Hooks } from '@server/lib/plugins/hooks' 5import { Hooks } from '@server/lib/plugins/hooks'
6import { getVideoFilePath } from '@server/lib/video-paths' 6import { getVideoFilePath } from '@server/lib/video-paths'
7import { MStreamingPlaylist, MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' 7import { MStreamingPlaylist, MVideo, MVideoFile, MVideoFullLight } from '@server/types/models'
8import { HttpStatusCode } from '@shared/models' 8import { HttpStatusCode, VideoStreamingPlaylistType } from '@shared/models'
9import { VideoStreamingPlaylistType } from '@shared/models'
10import { STATIC_DOWNLOAD_PATHS } from '../initializers/constants' 9import { STATIC_DOWNLOAD_PATHS } from '../initializers/constants'
11import { asyncMiddleware, videosDownloadValidator } from '../middlewares' 10import { asyncMiddleware, videosDownloadValidator } from '../middlewares'
12 11