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/lib | |
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/lib')
-rw-r--r-- | server/lib/activitypub/actors/shared/object-to-model-attributes.ts | 3 | ||||
-rw-r--r-- | server/lib/auth/oauth.ts | 2 | ||||
-rw-r--r-- | server/lib/client-html.ts | 2 | ||||
-rw-r--r-- | server/lib/hls.ts | 2 | ||||
-rw-r--r-- | server/lib/local-actor.ts | 3 | ||||
-rw-r--r-- | server/lib/paths.ts | 3 | ||||
-rw-r--r-- | server/lib/user.ts | 2 | ||||
-rw-r--r-- | server/lib/video-path-manager.ts | 2 |
8 files changed, 8 insertions, 11 deletions
diff --git a/server/lib/activitypub/actors/shared/object-to-model-attributes.ts b/server/lib/activitypub/actors/shared/object-to-model-attributes.ts index 1ad89ac56..38d93c108 100644 --- a/server/lib/activitypub/actors/shared/object-to-model-attributes.ts +++ b/server/lib/activitypub/actors/shared/object-to-model-attributes.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { getLowercaseExtension } from '@shared/core-utils' | ||
2 | import { isActivityPubUrlValid } from '@server/helpers/custom-validators/activitypub/misc' | 1 | import { isActivityPubUrlValid } from '@server/helpers/custom-validators/activitypub/misc' |
3 | import { buildUUID } from '@shared/core-utils/uuid' | ||
4 | import { MIMETYPES } from '@server/initializers/constants' | 2 | import { MIMETYPES } from '@server/initializers/constants' |
5 | import { ActorModel } from '@server/models/actor/actor' | 3 | import { ActorModel } from '@server/models/actor/actor' |
6 | import { FilteredModelAttributes } from '@server/types' | 4 | import { FilteredModelAttributes } from '@server/types' |
5 | import { buildUUID, getLowercaseExtension } from '@shared/core-utils' | ||
7 | import { ActivityPubActor, ActorImageType } from '@shared/models' | 6 | import { ActivityPubActor, ActorImageType } from '@shared/models' |
8 | 7 | ||
9 | function getActorAttributesFromObject ( | 8 | function getActorAttributesFromObject ( |
diff --git a/server/lib/auth/oauth.ts b/server/lib/auth/oauth.ts index 47bc8c055..dc0022852 100644 --- a/server/lib/auth/oauth.ts +++ b/server/lib/auth/oauth.ts | |||
@@ -8,7 +8,7 @@ import { | |||
8 | UnauthorizedClientError, | 8 | UnauthorizedClientError, |
9 | UnsupportedGrantTypeError | 9 | UnsupportedGrantTypeError |
10 | } from 'oauth2-server' | 10 | } from 'oauth2-server' |
11 | import { sha1 } from '@shared/core-utils/crypto' | 11 | import { sha1 } from '@shared/core-utils/common/crypto' |
12 | import { randomBytesPromise } from '@server/helpers/core-utils' | 12 | import { randomBytesPromise } from '@server/helpers/core-utils' |
13 | import { MOAuthClient } from '@server/types/models' | 13 | import { MOAuthClient } from '@server/types/models' |
14 | import { OAUTH_LIFETIME } from '../../initializers/constants' | 14 | import { OAUTH_LIFETIME } from '../../initializers/constants' |
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index dee7ca8ed..91708839b 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts | |||
@@ -9,7 +9,7 @@ import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from | |||
9 | import { HttpStatusCode } from '../../shared/models/http/http-error-codes' | 9 | import { HttpStatusCode } from '../../shared/models/http/http-error-codes' |
10 | import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos' | 10 | import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos' |
11 | import { isTestInstance } from '../helpers/core-utils' | 11 | import { isTestInstance } from '../helpers/core-utils' |
12 | import { sha256 } from '@shared/core-utils/crypto' | 12 | import { sha256 } from '@shared/core-utils/common/crypto' |
13 | import { logger } from '../helpers/logger' | 13 | import { logger } from '../helpers/logger' |
14 | import { mdToPlainText } from '../helpers/markdown' | 14 | import { mdToPlainText } from '../helpers/markdown' |
15 | import { CONFIG } from '../initializers/config' | 15 | import { CONFIG } from '../initializers/config' |
diff --git a/server/lib/hls.ts b/server/lib/hls.ts index 220b7733b..e4904be5f 100644 --- a/server/lib/hls.ts +++ b/server/lib/hls.ts | |||
@@ -2,7 +2,7 @@ import { close, ensureDir, move, open, outputJSON, read, readFile, remove, stat, | |||
2 | import { flatten, uniq } from 'lodash' | 2 | import { flatten, uniq } from 'lodash' |
3 | import { basename, dirname, join } from 'path' | 3 | import { basename, dirname, join } from 'path' |
4 | import { MStreamingPlaylistFilesVideo, MVideo, MVideoUUID } from '@server/types/models' | 4 | import { MStreamingPlaylistFilesVideo, MVideo, MVideoUUID } from '@server/types/models' |
5 | import { sha256 } from '@shared/core-utils/crypto' | 5 | import { sha256 } from '@shared/core-utils/common/crypto' |
6 | import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamSize } from '../helpers/ffprobe-utils' | 6 | import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamSize } from '../helpers/ffprobe-utils' |
7 | import { logger } from '../helpers/logger' | 7 | import { logger } from '../helpers/logger' |
8 | import { doRequest, doRequestAndSaveToFile } from '../helpers/requests' | 8 | import { doRequest, doRequestAndSaveToFile } from '../helpers/requests' |
diff --git a/server/lib/local-actor.ts b/server/lib/local-actor.ts index 572696f2a..04ad98f3e 100644 --- a/server/lib/local-actor.ts +++ b/server/lib/local-actor.ts | |||
@@ -2,9 +2,8 @@ import 'multer' | |||
2 | import { queue } from 'async' | 2 | import { queue } from 'async' |
3 | import LRUCache from 'lru-cache' | 3 | import LRUCache from 'lru-cache' |
4 | import { join } from 'path' | 4 | import { join } from 'path' |
5 | import { getLowercaseExtension } from '@shared/core-utils' | ||
6 | import { buildUUID } from '@shared/core-utils/uuid' | ||
7 | import { ActorModel } from '@server/models/actor/actor' | 5 | import { ActorModel } from '@server/models/actor/actor' |
6 | import { buildUUID, getLowercaseExtension } from '@shared/core-utils' | ||
8 | import { ActivityPubActorType, ActorImageType } from '@shared/models' | 7 | import { ActivityPubActorType, ActorImageType } from '@shared/models' |
9 | import { retryTransactionWrapper } from '../helpers/database-utils' | 8 | import { retryTransactionWrapper } from '../helpers/database-utils' |
10 | import { processImage } from '../helpers/image-utils' | 9 | import { processImage } from '../helpers/image-utils' |
diff --git a/server/lib/paths.ts b/server/lib/paths.ts index d8cf812e3..bf0c3a86b 100644 --- a/server/lib/paths.ts +++ b/server/lib/paths.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { join } from 'path' | 1 | import { join } from 'path' |
2 | import { buildUUID } from '@shared/core-utils/uuid' | ||
3 | import { CONFIG } from '@server/initializers/config' | 2 | import { CONFIG } from '@server/initializers/config' |
4 | import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' | 3 | import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' |
5 | import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/types/models' | 4 | import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/types/models' |
6 | import { removeFragmentedMP4Ext } from '@shared/core-utils' | 5 | import { buildUUID, removeFragmentedMP4Ext } from '@shared/core-utils' |
7 | 6 | ||
8 | // ################## Video file name ################## | 7 | // ################## Video file name ################## |
9 | 8 | ||
diff --git a/server/lib/user.ts b/server/lib/user.ts index 230bf37d0..3ba0c0ca4 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Transaction } from 'sequelize/types' | 1 | import { Transaction } from 'sequelize/types' |
2 | import { buildUUID } from '@shared/core-utils/uuid' | ||
3 | import { UserModel } from '@server/models/user/user' | 2 | import { UserModel } from '@server/models/user/user' |
4 | import { MActorDefault } from '@server/types/models/actor' | 3 | import { MActorDefault } from '@server/types/models/actor' |
4 | import { buildUUID } from '@shared/core-utils' | ||
5 | import { ActivityPubActorType } from '../../shared/models/activitypub' | 5 | import { ActivityPubActorType } from '../../shared/models/activitypub' |
6 | import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users' | 6 | import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users' |
7 | import { SERVER_ACTOR_NAME, WEBSERVER } from '../initializers/constants' | 7 | import { SERVER_ACTOR_NAME, WEBSERVER } from '../initializers/constants' |
diff --git a/server/lib/video-path-manager.ts b/server/lib/video-path-manager.ts index 429b36df9..4027f885d 100644 --- a/server/lib/video-path-manager.ts +++ b/server/lib/video-path-manager.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { remove } from 'fs-extra' | 1 | import { remove } from 'fs-extra' |
2 | import { extname, join } from 'path' | 2 | import { extname, join } from 'path' |
3 | import { buildUUID } from '@shared/core-utils/uuid' | ||
4 | import { extractVideo } from '@server/helpers/video' | 3 | import { extractVideo } from '@server/helpers/video' |
5 | import { CONFIG } from '@server/initializers/config' | 4 | import { CONFIG } from '@server/initializers/config' |
6 | import { | 5 | import { |
@@ -11,6 +10,7 @@ import { | |||
11 | MVideoFileVideo, | 10 | MVideoFileVideo, |
12 | MVideoUUID | 11 | MVideoUUID |
13 | } from '@server/types/models' | 12 | } from '@server/types/models' |
13 | import { buildUUID } from '@shared/core-utils' | ||
14 | import { VideoStorage } from '@shared/models' | 14 | import { VideoStorage } from '@shared/models' |
15 | import { makeHLSFileAvailable, makeWebTorrentFileAvailable } from './object-storage' | 15 | import { makeHLSFileAvailable, makeWebTorrentFileAvailable } from './object-storage' |
16 | import { getHLSDirectory, getHLSRedundancyDirectory, getHlsResolutionPlaylistFilename } from './paths' | 16 | import { getHLSDirectory, getHLSRedundancyDirectory, getHlsResolutionPlaylistFilename } from './paths' |