From c55e3d7227fe1453869e309025996b9d75256d5d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 17 Dec 2021 11:58:15 +0100 Subject: Move test functions outside extra-utils --- server/lib/activitypub/actors/shared/object-to-model-attributes.ts | 3 +-- server/lib/auth/oauth.ts | 2 +- server/lib/client-html.ts | 2 +- server/lib/hls.ts | 2 +- server/lib/local-actor.ts | 3 +-- server/lib/paths.ts | 3 +-- server/lib/user.ts | 2 +- server/lib/video-path-manager.ts | 2 +- 8 files changed, 8 insertions(+), 11 deletions(-) (limited to 'server/lib') 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 @@ -import { getLowercaseExtension } from '@shared/core-utils' import { isActivityPubUrlValid } from '@server/helpers/custom-validators/activitypub/misc' -import { buildUUID } from '@shared/core-utils/uuid' import { MIMETYPES } from '@server/initializers/constants' import { ActorModel } from '@server/models/actor/actor' import { FilteredModelAttributes } from '@server/types' +import { buildUUID, getLowercaseExtension } from '@shared/core-utils' import { ActivityPubActor, ActorImageType } from '@shared/models' 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 { UnauthorizedClientError, UnsupportedGrantTypeError } from 'oauth2-server' -import { sha1 } from '@shared/core-utils/crypto' +import { sha1 } from '@shared/core-utils/common/crypto' import { randomBytesPromise } from '@server/helpers/core-utils' import { MOAuthClient } from '@server/types/models' 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 import { HttpStatusCode } from '../../shared/models/http/http-error-codes' import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos' import { isTestInstance } from '../helpers/core-utils' -import { sha256 } from '@shared/core-utils/crypto' +import { sha256 } from '@shared/core-utils/common/crypto' import { logger } from '../helpers/logger' import { mdToPlainText } from '../helpers/markdown' 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, import { flatten, uniq } from 'lodash' import { basename, dirname, join } from 'path' import { MStreamingPlaylistFilesVideo, MVideo, MVideoUUID } from '@server/types/models' -import { sha256 } from '@shared/core-utils/crypto' +import { sha256 } from '@shared/core-utils/common/crypto' import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamSize } from '../helpers/ffprobe-utils' import { logger } from '../helpers/logger' 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' import { queue } from 'async' import LRUCache from 'lru-cache' import { join } from 'path' -import { getLowercaseExtension } from '@shared/core-utils' -import { buildUUID } from '@shared/core-utils/uuid' import { ActorModel } from '@server/models/actor/actor' +import { buildUUID, getLowercaseExtension } from '@shared/core-utils' import { ActivityPubActorType, ActorImageType } from '@shared/models' import { retryTransactionWrapper } from '../helpers/database-utils' 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 @@ import { join } from 'path' -import { buildUUID } from '@shared/core-utils/uuid' import { CONFIG } from '@server/initializers/config' import { HLS_REDUNDANCY_DIRECTORY, HLS_STREAMING_PLAYLIST_DIRECTORY } from '@server/initializers/constants' import { isStreamingPlaylist, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoUUID } from '@server/types/models' -import { removeFragmentedMP4Ext } from '@shared/core-utils' +import { buildUUID, removeFragmentedMP4Ext } from '@shared/core-utils' // ################## Video file name ################## 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 @@ import { Transaction } from 'sequelize/types' -import { buildUUID } from '@shared/core-utils/uuid' import { UserModel } from '@server/models/user/user' import { MActorDefault } from '@server/types/models/actor' +import { buildUUID } from '@shared/core-utils' import { ActivityPubActorType } from '../../shared/models/activitypub' import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users' 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 @@ import { remove } from 'fs-extra' import { extname, join } from 'path' -import { buildUUID } from '@shared/core-utils/uuid' import { extractVideo } from '@server/helpers/video' import { CONFIG } from '@server/initializers/config' import { @@ -11,6 +10,7 @@ import { MVideoFileVideo, MVideoUUID } from '@server/types/models' +import { buildUUID } from '@shared/core-utils' import { VideoStorage } from '@shared/models' import { makeHLSFileAvailable, makeWebTorrentFileAvailable } from './object-storage' import { getHLSDirectory, getHLSRedundancyDirectory, getHlsResolutionPlaylistFilename } from './paths' -- cgit v1.2.3