aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-17 11:58:15 +0100
committerChocobozzz <me@florianbigard.com>2021-12-17 12:24:03 +0100
commitc55e3d7227fe1453869e309025996b9d75256d5d (patch)
tree08e9b0ca210d75c82c8606fef0852eca020e8e0e /server/lib
parentbf54587a3e2ad9c2c186828f2a5682b91ee2cc00 (diff)
downloadPeerTube-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.ts3
-rw-r--r--server/lib/auth/oauth.ts2
-rw-r--r--server/lib/client-html.ts2
-rw-r--r--server/lib/hls.ts2
-rw-r--r--server/lib/local-actor.ts3
-rw-r--r--server/lib/paths.ts3
-rw-r--r--server/lib/user.ts2
-rw-r--r--server/lib/video-path-manager.ts2
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 @@
1import { getLowercaseExtension } from '@shared/core-utils'
2import { isActivityPubUrlValid } from '@server/helpers/custom-validators/activitypub/misc' 1import { isActivityPubUrlValid } from '@server/helpers/custom-validators/activitypub/misc'
3import { buildUUID } from '@shared/core-utils/uuid'
4import { MIMETYPES } from '@server/initializers/constants' 2import { MIMETYPES } from '@server/initializers/constants'
5import { ActorModel } from '@server/models/actor/actor' 3import { ActorModel } from '@server/models/actor/actor'
6import { FilteredModelAttributes } from '@server/types' 4import { FilteredModelAttributes } from '@server/types'
5import { buildUUID, getLowercaseExtension } from '@shared/core-utils'
7import { ActivityPubActor, ActorImageType } from '@shared/models' 6import { ActivityPubActor, ActorImageType } from '@shared/models'
8 7
9function getActorAttributesFromObject ( 8function 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'
11import { sha1 } from '@shared/core-utils/crypto' 11import { sha1 } from '@shared/core-utils/common/crypto'
12import { randomBytesPromise } from '@server/helpers/core-utils' 12import { randomBytesPromise } from '@server/helpers/core-utils'
13import { MOAuthClient } from '@server/types/models' 13import { MOAuthClient } from '@server/types/models'
14import { OAUTH_LIFETIME } from '../../initializers/constants' 14import { 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
9import { HttpStatusCode } from '../../shared/models/http/http-error-codes' 9import { HttpStatusCode } from '../../shared/models/http/http-error-codes'
10import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos' 10import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos'
11import { isTestInstance } from '../helpers/core-utils' 11import { isTestInstance } from '../helpers/core-utils'
12import { sha256 } from '@shared/core-utils/crypto' 12import { sha256 } from '@shared/core-utils/common/crypto'
13import { logger } from '../helpers/logger' 13import { logger } from '../helpers/logger'
14import { mdToPlainText } from '../helpers/markdown' 14import { mdToPlainText } from '../helpers/markdown'
15import { CONFIG } from '../initializers/config' 15import { 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,
2import { flatten, uniq } from 'lodash' 2import { flatten, uniq } from 'lodash'
3import { basename, dirname, join } from 'path' 3import { basename, dirname, join } from 'path'
4import { MStreamingPlaylistFilesVideo, MVideo, MVideoUUID } from '@server/types/models' 4import { MStreamingPlaylistFilesVideo, MVideo, MVideoUUID } from '@server/types/models'
5import { sha256 } from '@shared/core-utils/crypto' 5import { sha256 } from '@shared/core-utils/common/crypto'
6import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamSize } from '../helpers/ffprobe-utils' 6import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamSize } from '../helpers/ffprobe-utils'
7import { logger } from '../helpers/logger' 7import { logger } from '../helpers/logger'
8import { doRequest, doRequestAndSaveToFile } from '../helpers/requests' 8import { 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'
2import { queue } from 'async' 2import { queue } from 'async'
3import LRUCache from 'lru-cache' 3import LRUCache from 'lru-cache'
4import { join } from 'path' 4import { join } from 'path'
5import { getLowercaseExtension } from '@shared/core-utils'
6import { buildUUID } from '@shared/core-utils/uuid'
7import { ActorModel } from '@server/models/actor/actor' 5import { ActorModel } from '@server/models/actor/actor'
6import { buildUUID, getLowercaseExtension } from '@shared/core-utils'
8import { ActivityPubActorType, ActorImageType } from '@shared/models' 7import { ActivityPubActorType, ActorImageType } from '@shared/models'
9import { retryTransactionWrapper } from '../helpers/database-utils' 8import { retryTransactionWrapper } from '../helpers/database-utils'
10import { processImage } from '../helpers/image-utils' 9import { 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 @@
1import { join } from 'path' 1import { join } from 'path'
2import { buildUUID } from '@shared/core-utils/uuid'
3import { CONFIG } from '@server/initializers/config' 2import { CONFIG } from '@server/initializers/config'
4import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' 3import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants'
5import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/types/models' 4import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/types/models'
6import { removeFragmentedMP4Ext } from '@shared/core-utils' 5import { 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 @@
1import { Transaction } from 'sequelize/types' 1import { Transaction } from 'sequelize/types'
2import { buildUUID } from '@shared/core-utils/uuid'
3import { UserModel } from '@server/models/user/user' 2import { UserModel } from '@server/models/user/user'
4import { MActorDefault } from '@server/types/models/actor' 3import { MActorDefault } from '@server/types/models/actor'
4import { buildUUID } from '@shared/core-utils'
5import { ActivityPubActorType } from '../../shared/models/activitypub' 5import { ActivityPubActorType } from '../../shared/models/activitypub'
6import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users' 6import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users'
7import { SERVER_ACTOR_NAME, WEBSERVER } from '../initializers/constants' 7import { 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 @@
1import { remove } from 'fs-extra' 1import { remove } from 'fs-extra'
2import { extname, join } from 'path' 2import { extname, join } from 'path'
3import { buildUUID } from '@shared/core-utils/uuid'
4import { extractVideo } from '@server/helpers/video' 3import { extractVideo } from '@server/helpers/video'
5import { CONFIG } from '@server/initializers/config' 4import { CONFIG } from '@server/initializers/config'
6import { 5import {
@@ -11,6 +10,7 @@ import {
11 MVideoFileVideo, 10 MVideoFileVideo,
12 MVideoUUID 11 MVideoUUID
13} from '@server/types/models' 12} from '@server/types/models'
13import { buildUUID } from '@shared/core-utils'
14import { VideoStorage } from '@shared/models' 14import { VideoStorage } from '@shared/models'
15import { makeHLSFileAvailable, makeWebTorrentFileAvailable } from './object-storage' 15import { makeHLSFileAvailable, makeWebTorrentFileAvailable } from './object-storage'
16import { getHLSDirectory, getHLSRedundancyDirectory, getHlsResolutionPlaylistFilename } from './paths' 16import { getHLSDirectory, getHLSRedundancyDirectory, getHlsResolutionPlaylistFilename } from './paths'