diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-17 11:58:15 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-17 12:24:03 +0100 |
commit | c55e3d7227fe1453869e309025996b9d75256d5d (patch) | |
tree | 08e9b0ca210d75c82c8606fef0852eca020e8e0e /server/controllers | |
parent | bf54587a3e2ad9c2c186828f2a5682b91ee2cc00 (diff) | |
download | PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.gz PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.tar.zst PeerTube-c55e3d7227fe1453869e309025996b9d75256d5d.zip |
Move test functions outside extra-utils
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/users/token.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/video-playlist.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/live.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/upload.ts | 3 |
4 files changed, 4 insertions, 5 deletions
diff --git a/server/controllers/api/users/token.ts b/server/controllers/api/users/token.ts index 42f4f6096..5ada4a805 100644 --- a/server/controllers/api/users/token.ts +++ b/server/controllers/api/users/token.ts | |||
@@ -1,13 +1,13 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import RateLimit from 'express-rate-limit' | 2 | import RateLimit from 'express-rate-limit' |
3 | import { logger } from '@server/helpers/logger' | 3 | import { logger } from '@server/helpers/logger' |
4 | import { buildUUID } from '@shared/core-utils/uuid' | ||
5 | import { CONFIG } from '@server/initializers/config' | 4 | import { CONFIG } from '@server/initializers/config' |
6 | import { getAuthNameFromRefreshGrant, getBypassFromExternalAuth, getBypassFromPasswordGrant } from '@server/lib/auth/external-auth' | 5 | import { getAuthNameFromRefreshGrant, getBypassFromExternalAuth, getBypassFromPasswordGrant } from '@server/lib/auth/external-auth' |
7 | import { handleOAuthToken } from '@server/lib/auth/oauth' | 6 | import { handleOAuthToken } from '@server/lib/auth/oauth' |
8 | import { BypassLogin, revokeToken } from '@server/lib/auth/oauth-model' | 7 | import { BypassLogin, revokeToken } from '@server/lib/auth/oauth-model' |
9 | import { Hooks } from '@server/lib/plugins/hooks' | 8 | import { Hooks } from '@server/lib/plugins/hooks' |
10 | import { asyncMiddleware, authenticate, openapiOperationDoc } from '@server/middlewares' | 9 | import { asyncMiddleware, authenticate, openapiOperationDoc } from '@server/middlewares' |
10 | import { buildUUID } from '@shared/core-utils' | ||
11 | import { ScopedToken } from '@shared/models/users/user-scoped-token' | 11 | import { ScopedToken } from '@shared/models/users/user-scoped-token' |
12 | 12 | ||
13 | const tokensRouter = express.Router() | 13 | const tokensRouter = express.Router() |
diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts index f8f07b1c6..dc1947764 100644 --- a/server/controllers/api/video-playlist.ts +++ b/server/controllers/api/video-playlist.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | import { uuidToShort } from '@shared/core-utils/uuid' | ||
4 | import { scheduleRefreshIfNeeded } from '@server/lib/activitypub/playlists' | 3 | import { scheduleRefreshIfNeeded } from '@server/lib/activitypub/playlists' |
5 | import { Hooks } from '@server/lib/plugins/hooks' | 4 | import { Hooks } from '@server/lib/plugins/hooks' |
6 | import { getServerActor } from '@server/models/application/application' | 5 | import { getServerActor } from '@server/models/application/application' |
7 | import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/types/models' | 6 | import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/types/models' |
7 | import { uuidToShort } from '@shared/core-utils' | ||
8 | import { VideoPlaylistCreateResult, VideoPlaylistElementCreateResult } from '@shared/models' | 8 | import { VideoPlaylistCreateResult, VideoPlaylistElementCreateResult } from '@shared/models' |
9 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | 9 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' |
10 | import { VideoPlaylistCreate } from '../../../shared/models/videos/playlist/video-playlist-create.model' | 10 | import { VideoPlaylistCreate } from '../../../shared/models/videos/playlist/video-playlist-create.model' |
diff --git a/server/controllers/api/videos/live.ts b/server/controllers/api/videos/live.ts index e466d041b..4ee39aa4f 100644 --- a/server/controllers/api/videos/live.ts +++ b/server/controllers/api/videos/live.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { createReqFiles } from '@server/helpers/express-utils' | 2 | import { createReqFiles } from '@server/helpers/express-utils' |
3 | import { buildUUID, uuidToShort } from '@shared/core-utils/uuid' | ||
4 | import { CONFIG } from '@server/initializers/config' | 3 | import { CONFIG } from '@server/initializers/config' |
5 | import { ASSETS_PATH, MIMETYPES } from '@server/initializers/constants' | 4 | import { ASSETS_PATH, MIMETYPES } from '@server/initializers/constants' |
6 | import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' | 5 | import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' |
@@ -10,6 +9,7 @@ import { buildLocalVideoFromReq, buildVideoThumbnailsFromReq, setVideoTags } fro | |||
10 | import { videoLiveAddValidator, videoLiveGetValidator, videoLiveUpdateValidator } from '@server/middlewares/validators/videos/video-live' | 9 | import { videoLiveAddValidator, videoLiveGetValidator, videoLiveUpdateValidator } from '@server/middlewares/validators/videos/video-live' |
11 | import { VideoLiveModel } from '@server/models/video/video-live' | 10 | import { VideoLiveModel } from '@server/models/video/video-live' |
12 | import { MVideoDetails, MVideoFullLight } from '@server/types/models' | 11 | import { MVideoDetails, MVideoFullLight } from '@server/types/models' |
12 | import { buildUUID, uuidToShort } from '@shared/core-utils' | ||
13 | import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared' | 13 | import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared' |
14 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 14 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
15 | import { logger } from '../../../helpers/logger' | 15 | import { logger } from '../../../helpers/logger' |
diff --git a/server/controllers/api/videos/upload.ts b/server/controllers/api/videos/upload.ts index a4d0f980f..9f620c04d 100644 --- a/server/controllers/api/videos/upload.ts +++ b/server/controllers/api/videos/upload.ts | |||
@@ -1,9 +1,7 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { move } from 'fs-extra' | 2 | import { move } from 'fs-extra' |
3 | import { basename } from 'path' | 3 | import { basename } from 'path' |
4 | import { getLowercaseExtension } from '@shared/core-utils' | ||
5 | import { getResumableUploadPath } from '@server/helpers/upload' | 4 | import { getResumableUploadPath } from '@server/helpers/upload' |
6 | import { uuidToShort } from '@shared/core-utils/uuid' | ||
7 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' | 5 | import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' |
8 | import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' | 6 | import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url' |
9 | import { generateWebTorrentVideoFilename } from '@server/lib/paths' | 7 | import { generateWebTorrentVideoFilename } from '@server/lib/paths' |
@@ -20,6 +18,7 @@ import { VideoPathManager } from '@server/lib/video-path-manager' | |||
20 | import { buildNextVideoState } from '@server/lib/video-state' | 18 | import { buildNextVideoState } from '@server/lib/video-state' |
21 | import { openapiOperationDoc } from '@server/middlewares/doc' | 19 | import { openapiOperationDoc } from '@server/middlewares/doc' |
22 | 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' | ||
23 | import { VideoCreate, VideoState } from '../../../../shared' | 22 | import { VideoCreate, VideoState } from '../../../../shared' |
24 | import { HttpStatusCode } from '../../../../shared/models' | 23 | import { HttpStatusCode } from '../../../../shared/models' |
25 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' | 24 | import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger' |