diff options
Diffstat (limited to 'server/controllers')
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { asyncMiddleware, authenticate } from '../../middlewares' | 2 | import { removeComment } from '@server/lib/video-comment' |
3 | import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk' | 3 | import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk' |
4 | import { VideoCommentModel } from '@server/models/video/video-comment' | 4 | import { VideoCommentModel } from '@server/models/video/video-comment' |
5 | import { removeComment } from '@server/lib/video-comment' | ||
6 | import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model' | ||
7 | import { HttpStatusCode } from '@shared/models' | 5 | import { HttpStatusCode } from '@shared/models' |
6 | import { BulkRemoveCommentsOfBody } from '@shared/models/bulk/bulk-remove-comments-of-body.model' | ||
7 | import { asyncMiddleware, authenticate } from '../../middlewares' | ||
8 | 8 | ||
9 | const bulkRouter = express.Router() | 9 | const 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 @@ | |||
1 | import { ServerConfigManager } from '@server/lib/server-config-manager' | ||
2 | import * as express from 'express' | 1 | import * as express from 'express' |
3 | import { remove, writeJSON } from 'fs-extra' | 2 | import { remove, writeJSON } from 'fs-extra' |
4 | import { snakeCase } from 'lodash' | 3 | import { snakeCase } from 'lodash' |
5 | import validator from 'validator' | 4 | import validator from 'validator' |
5 | import { ServerConfigManager } from '@server/lib/server-config-manager' | ||
6 | import { UserRight } from '../../../shared' | 6 | import { UserRight } from '../../../shared' |
7 | import { About } from '../../../shared/models/server/about.model' | 7 | import { About } from '../../../shared/models/server/about.model' |
8 | import { CustomConfig } from '../../../shared/models/server/custom-config.model' | 8 | import { 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { ServerConfigManager } from '@server/lib/server-config-manager' | 2 | import { ServerConfigManager } from '@server/lib/server-config-manager' |
3 | import { ActorCustomPageModel } from '@server/models/account/actor-custom-page' | 3 | import { ActorCustomPageModel } from '@server/models/account/actor-custom-page' |
4 | import { HttpStatusCode } from '@shared/models' | 4 | import { HttpStatusCode, UserRight } from '@shared/models' |
5 | import { UserRight } from '@shared/models' | ||
6 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' | 5 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../middlewares' |
7 | 6 | ||
8 | const customPageRouter = express.Router() | 7 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import * as memoizee from 'memoizee' | ||
3 | import { logger } from '@server/helpers/logger' | ||
4 | import { CategoryOverview, ChannelOverview, TagOverview, VideosOverview } from '../../../shared/models/overviews' | ||
2 | import { buildNSFWFilter } from '../../helpers/express-utils' | 5 | import { buildNSFWFilter } from '../../helpers/express-utils' |
3 | import { VideoModel } from '../../models/video/video' | 6 | import { MEMOIZE_TTL, OVERVIEWS } from '../../initializers/constants' |
4 | import { asyncMiddleware, optionalAuthenticate, videosOverviewValidator } from '../../middlewares' | 7 | import { asyncMiddleware, optionalAuthenticate, videosOverviewValidator } from '../../middlewares' |
5 | import { TagModel } from '../../models/video/tag' | 8 | import { TagModel } from '../../models/video/tag' |
6 | import { CategoryOverview, ChannelOverview, TagOverview, VideosOverview } from '../../../shared/models/overviews' | 9 | import { VideoModel } from '../../models/video/video' |
7 | import { MEMOIZE_TTL, OVERVIEWS } from '../../initializers/constants' | ||
8 | import * as memoizee from 'memoizee' | ||
9 | import { logger } from '@server/helpers/logger' | ||
10 | 10 | ||
11 | const overviewsRouter = express.Router() | 11 | const 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' |
25 | import { PluginModel } from '@server/models/server/plugin' | 25 | import { PluginModel } from '@server/models/server/plugin' |
26 | import { HttpStatusCode } from '@shared/models' | ||
27 | import { | 26 | import { |
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' | |||
6 | import { Hooks } from '@server/lib/plugins/hooks' | 6 | import { Hooks } from '@server/lib/plugins/hooks' |
7 | import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' | 7 | import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' |
8 | import { getServerActor } from '@server/models/application/application' | 8 | import { getServerActor } from '@server/models/application/application' |
9 | import { HttpStatusCode } from '@shared/models' | 9 | import { HttpStatusCode, ResultList, VideoChannel } from '@shared/models' |
10 | import { ResultList, VideoChannel } from '@shared/models' | ||
11 | import { VideoChannelsSearchQuery } from '../../../../shared/models/search' | 10 | import { VideoChannelsSearchQuery } from '../../../../shared/models/search' |
12 | import { isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils' | 11 | import { isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils' |
13 | import { logger } from '../../../helpers/logger' | 12 | import { 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' | |||
5 | import { doJSONRequest } from '@server/helpers/requests' | 5 | import { doJSONRequest } from '@server/helpers/requests' |
6 | import { getFormattedObjects } from '@server/helpers/utils' | 6 | import { getFormattedObjects } from '@server/helpers/utils' |
7 | import { CONFIG } from '@server/initializers/config' | 7 | import { CONFIG } from '@server/initializers/config' |
8 | import { WEBSERVER } from '@server/initializers/constants' | ||
8 | import { getOrCreateAPVideoPlaylist } from '@server/lib/activitypub/playlists/get' | 9 | import { getOrCreateAPVideoPlaylist } from '@server/lib/activitypub/playlists/get' |
9 | import { Hooks } from '@server/lib/plugins/hooks' | 10 | import { Hooks } from '@server/lib/plugins/hooks' |
10 | import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' | 11 | import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' |
11 | import { getServerActor } from '@server/models/application/application' | 12 | import { getServerActor } from '@server/models/application/application' |
12 | import { VideoPlaylistModel } from '@server/models/video/video-playlist' | 13 | import { VideoPlaylistModel } from '@server/models/video/video-playlist' |
13 | import { MVideoPlaylistFullSummary } from '@server/types/models' | 14 | import { MVideoPlaylistFullSummary } from '@server/types/models' |
14 | import { HttpStatusCode } from '@shared/models' | 15 | import { HttpStatusCode, ResultList, VideoPlaylist, VideoPlaylistsSearchQuery } from '@shared/models' |
15 | import { ResultList, VideoPlaylist, VideoPlaylistsSearchQuery } from '@shared/models' | ||
16 | import { | 16 | import { |
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' |
26 | import { WEBSERVER } from '@server/initializers/constants' | ||
27 | 26 | ||
28 | const searchPlaylistsRouter = express.Router() | 27 | const 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' | |||
6 | import { getOrCreateAPVideo } from '@server/lib/activitypub/videos' | 6 | import { getOrCreateAPVideo } from '@server/lib/activitypub/videos' |
7 | import { Hooks } from '@server/lib/plugins/hooks' | 7 | import { Hooks } from '@server/lib/plugins/hooks' |
8 | import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' | 8 | import { buildMutedForSearchIndex, isSearchIndexSearch, isURISearch } from '@server/lib/search' |
9 | import { HttpStatusCode } from '@shared/models' | 9 | import { HttpStatusCode, ResultList, Video } from '@shared/models' |
10 | import { ResultList, Video } from '@shared/models' | ||
11 | import { VideosSearchQuery } from '../../../../shared/models/search' | 10 | import { VideosSearchQuery } from '../../../../shared/models/search' |
12 | import { buildNSFWFilter, isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils' | 11 | import { buildNSFWFilter, isUserAbleToSearchRemoteURI } from '../../../helpers/express-utils' |
13 | import { logger } from '../../../helpers/logger' | 12 | import { 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { asyncMiddleware, contactAdministratorValidator } from '../../../middlewares' | ||
3 | import { Redis } from '../../../lib/redis' | ||
4 | import { Emailer } from '../../../lib/emailer' | ||
5 | import { ContactForm } from '../../../../shared/models/server' | ||
6 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 2 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
3 | import { ContactForm } from '../../../../shared/models/server' | ||
4 | import { Emailer } from '../../../lib/emailer' | ||
5 | import { Redis } from '../../../lib/redis' | ||
6 | import { asyncMiddleware, contactAdministratorValidator } from '../../../middlewares' | ||
7 | 7 | ||
8 | const contactRouter = express.Router() | 8 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { contactRouter } from './contact' | ||
3 | import { debugRouter } from './debug' | ||
2 | import { serverFollowsRouter } from './follows' | 4 | import { serverFollowsRouter } from './follows' |
3 | import { statsRouter } from './stats' | 5 | import { logsRouter } from './logs' |
4 | import { serverRedundancyRouter } from './redundancy' | 6 | import { serverRedundancyRouter } from './redundancy' |
5 | import { serverBlocklistRouter } from './server-blocklist' | 7 | import { serverBlocklistRouter } from './server-blocklist' |
6 | import { contactRouter } from './contact' | 8 | import { statsRouter } from './stats' |
7 | import { logsRouter } from './logs' | ||
8 | import { debugRouter } from './debug' | ||
9 | 9 | ||
10 | const serverRouter = express.Router() | 10 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { UserRight } from '../../../../shared/models/users' | ||
3 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../../middlewares' | ||
4 | import { mtimeSortFilesDesc } from '../../../../shared/core-utils/logs/logs' | ||
5 | import { readdir, readFile } from 'fs-extra' | 2 | import { readdir, readFile } from 'fs-extra' |
6 | import { AUDIT_LOG_FILENAME, MAX_LOGS_OUTPUT_CHARACTERS, LOG_FILENAME } from '../../../initializers/constants' | ||
7 | import { join } from 'path' | 3 | import { join } from 'path' |
8 | import { getAuditLogsValidator, getLogsValidator } from '../../../middlewares/validators/logs' | 4 | import { logger } from '@server/helpers/logger' |
5 | import { mtimeSortFilesDesc } from '../../../../shared/core-utils/logs/logs' | ||
9 | import { LogLevel } from '../../../../shared/models/server/log-level.type' | 6 | import { LogLevel } from '../../../../shared/models/server/log-level.type' |
7 | import { UserRight } from '../../../../shared/models/users' | ||
10 | import { CONFIG } from '../../../initializers/config' | 8 | import { CONFIG } from '../../../initializers/config' |
11 | import { logger } from '@server/helpers/logger' | 9 | import { AUDIT_LOG_FILENAME, LOG_FILENAME, MAX_LOGS_OUTPUT_CHARACTERS } from '../../../initializers/constants' |
10 | import { asyncMiddleware, authenticate, ensureUserHasRight } from '../../../middlewares' | ||
11 | import { getAuditLogsValidator, getLogsValidator } from '../../../middlewares/validators/logs' | ||
12 | 12 | ||
13 | const logsRouter = express.Router() | 13 | const 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' | |||
2 | import * as express from 'express' | 2 | import * as express from 'express' |
3 | import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger' | 3 | import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger' |
4 | import { Hooks } from '@server/lib/plugins/hooks' | 4 | import { Hooks } from '@server/lib/plugins/hooks' |
5 | import { AttributesOnly } from '@shared/core-utils' | ||
5 | import { ActorImageType, UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared' | 6 | import { ActorImageType, UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared' |
6 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 7 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
7 | import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model' | 8 | import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model' |
@@ -31,7 +32,6 @@ import { AccountVideoRateModel } from '../../../models/account/account-video-rat | |||
31 | import { UserModel } from '../../../models/user/user' | 32 | import { UserModel } from '../../../models/user/user' |
32 | import { VideoModel } from '../../../models/video/video' | 33 | import { VideoModel } from '../../../models/video/video' |
33 | import { VideoImportModel } from '../../../models/video/video-import' | 34 | import { VideoImportModel } from '../../../models/video/video-import' |
34 | import { AttributesOnly } from '@shared/core-utils' | ||
35 | 35 | ||
36 | const auditLogger = auditLoggerFactory('users') | 36 | const 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 @@ | |||
1 | import * as express from 'express' | ||
2 | import 'multer' | 1 | import 'multer' |
2 | import * as express from 'express' | ||
3 | import { logger } from '@server/helpers/logger' | ||
4 | import { UserNotificationModel } from '@server/models/user/user-notification' | ||
5 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
3 | import { getFormattedObjects } from '../../../helpers/utils' | 6 | import { getFormattedObjects } from '../../../helpers/utils' |
7 | import { addAccountInBlocklist, addServerInBlocklist, removeAccountFromBlocklist, removeServerFromBlocklist } from '../../../lib/blocklist' | ||
4 | import { | 8 | import { |
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' |
20 | import { AccountBlocklistModel } from '../../../models/account/account-blocklist' | 24 | import { AccountBlocklistModel } from '../../../models/account/account-blocklist' |
21 | import { addAccountInBlocklist, addServerInBlocklist, removeAccountFromBlocklist, removeServerFromBlocklist } from '../../../lib/blocklist' | ||
22 | import { ServerBlocklistModel } from '../../../models/server/server-blocklist' | 25 | import { ServerBlocklistModel } from '../../../models/server/server-blocklist' |
23 | import { UserNotificationModel } from '@server/models/user/user-notification' | ||
24 | import { logger } from '@server/helpers/logger' | ||
25 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
26 | 26 | ||
27 | const myBlocklistRouter = express.Router() | 27 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
3 | import { getFormattedObjects } from '../../../helpers/utils' | ||
4 | import { sequelizeTypescript } from '../../../initializers/database' | ||
2 | import { | 5 | import { |
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' |
11 | import { getFormattedObjects } from '../../../helpers/utils' | ||
12 | import { UserVideoHistoryModel } from '../../../models/user/user-video-history' | 14 | import { UserVideoHistoryModel } from '../../../models/user/user-video-history' |
13 | import { sequelizeTypescript } from '../../../initializers/database' | ||
14 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
15 | 15 | ||
16 | const myVideosHistoryRouter = express.Router() | 16 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { VideosExistInPlaylists } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model' | ||
2 | import { asyncMiddleware, authenticate } from '../../../middlewares' | 3 | import { asyncMiddleware, authenticate } from '../../../middlewares' |
3 | import { doVideosInPlaylistExistValidator } from '../../../middlewares/validators/videos/video-playlists' | 4 | import { doVideosInPlaylistExistValidator } from '../../../middlewares/validators/videos/video-playlists' |
4 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' | 5 | import { VideoPlaylistModel } from '../../../models/video/video-playlist' |
5 | import { VideosExistInPlaylists } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model' | ||
6 | 6 | ||
7 | const myVideoPlaylistsRouter = express.Router() | 7 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as 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 { UserRight, VideoBlacklistCreate } from '../../../../shared' |
4 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
4 | import { logger } from '../../../helpers/logger' | 5 | import { logger } from '../../../helpers/logger' |
5 | import { getFormattedObjects } from '../../../helpers/utils' | 6 | import { getFormattedObjects } from '../../../helpers/utils' |
6 | import { sequelizeTypescript } from '../../../initializers/database' | 7 | import { sequelizeTypescript } from '../../../initializers/database' |
@@ -19,7 +20,6 @@ import { | |||
19 | videosBlacklistUpdateValidator | 20 | videosBlacklistUpdateValidator |
20 | } from '../../../middlewares' | 21 | } from '../../../middlewares' |
21 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' | 22 | import { VideoBlacklistModel } from '../../../models/video/video-blacklist' |
22 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
23 | 23 | ||
24 | const blacklistRouter = express.Router() | 24 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
3 | import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models' | 2 | import { ResultList, ThreadsResultList, UserRight, VideoCommentCreate } from '../../../../shared/models' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
4 | import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model' | 4 | import { VideoCommentThreads } from '../../../../shared/models/videos/comment/video-comment.model' |
5 | import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger' | 5 | import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../../helpers/audit-logger' |
6 | import { getFormattedObjects } from '../../../helpers/utils' | 6 | import { 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { MVideoFullLight } from '@server/types/models' | ||
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
4 | import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos' | ||
2 | import { logger } from '../../../helpers/logger' | 5 | import { logger } from '../../../helpers/logger' |
6 | import { getFormattedObjects } from '../../../helpers/utils' | ||
3 | import { sequelizeTypescript } from '../../../initializers/database' | 7 | import { sequelizeTypescript } from '../../../initializers/database' |
8 | import { sendUpdateVideo } from '../../../lib/activitypub/send' | ||
9 | import { changeVideoChannelShare } from '../../../lib/activitypub/share' | ||
4 | import { | 10 | import { |
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' |
20 | import { VideoModel } from '../../../models/video/video' | ||
14 | import { VideoChangeOwnershipModel } from '../../../models/video/video-change-ownership' | 21 | import { VideoChangeOwnershipModel } from '../../../models/video/video-change-ownership' |
15 | import { VideoChangeOwnershipStatus, VideoState } from '../../../../shared/models/videos' | ||
16 | import { VideoChannelModel } from '../../../models/video/video-channel' | 22 | import { VideoChannelModel } from '../../../models/video/video-channel' |
17 | import { getFormattedObjects } from '../../../helpers/utils' | ||
18 | import { changeVideoChannelShare } from '../../../lib/activitypub/share' | ||
19 | import { sendUpdateVideo } from '../../../lib/activitypub/send' | ||
20 | import { VideoModel } from '../../../models/video/video' | ||
21 | import { MVideoFullLight } from '@server/types/models' | ||
22 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
23 | 23 | ||
24 | const ownershipVideoRouter = express.Router() | 24 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { UserVideoRateUpdate } from '../../../../shared' | 2 | import { UserVideoRateUpdate } from '../../../../shared' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
3 | import { logger } from '../../../helpers/logger' | 4 | import { logger } from '../../../helpers/logger' |
4 | import { VIDEO_RATE_TYPES } from '../../../initializers/constants' | 5 | import { VIDEO_RATE_TYPES } from '../../../initializers/constants' |
6 | import { sequelizeTypescript } from '../../../initializers/database' | ||
5 | import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates' | 7 | import { getLocalRateUrl, sendVideoRateChange } from '../../../lib/activitypub/video-rates' |
6 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares' | 8 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoUpdateRateValidator } from '../../../middlewares' |
7 | import { AccountModel } from '../../../models/account/account' | 9 | import { AccountModel } from '../../../models/account/account' |
8 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' | 10 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' |
9 | import { sequelizeTypescript } from '../../../initializers/database' | ||
10 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
11 | 11 | ||
12 | const rateVideoRouter = express.Router() | 12 | const 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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { UserWatchingVideo } from '../../../../shared' | 2 | import { UserWatchingVideo } from '../../../../shared' |
3 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
3 | import { | 4 | import { |
4 | asyncMiddleware, | 5 | asyncMiddleware, |
5 | asyncRetryTransactionMiddleware, | 6 | asyncRetryTransactionMiddleware, |
@@ -8,7 +9,6 @@ import { | |||
8 | videoWatchingValidator | 9 | videoWatchingValidator |
9 | } from '../../../middlewares' | 10 | } from '../../../middlewares' |
10 | import { UserVideoHistoryModel } from '../../../models/user/user-video-history' | 11 | import { UserVideoHistoryModel } from '../../../models/user/user-video-history' |
11 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | ||
12 | 12 | ||
13 | const watchingRouter = express.Router() | 13 | const 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 | |||
5 | import { Hooks } from '@server/lib/plugins/hooks' | 5 | import { Hooks } from '@server/lib/plugins/hooks' |
6 | import { getVideoFilePath } from '@server/lib/video-paths' | 6 | import { getVideoFilePath } from '@server/lib/video-paths' |
7 | import { MStreamingPlaylist, MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' | 7 | import { MStreamingPlaylist, MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' |
8 | import { HttpStatusCode } from '@shared/models' | 8 | import { HttpStatusCode, VideoStreamingPlaylistType } from '@shared/models' |
9 | import { VideoStreamingPlaylistType } from '@shared/models' | ||
10 | import { STATIC_DOWNLOAD_PATHS } from '../initializers/constants' | 9 | import { STATIC_DOWNLOAD_PATHS } from '../initializers/constants' |
11 | import { asyncMiddleware, videosDownloadValidator } from '../middlewares' | 10 | import { asyncMiddleware, videosDownloadValidator } from '../middlewares' |
12 | 11 | ||