From d17c7b4e8c52317bdc874917387b7a49f6cf8b01 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 24 Dec 2021 10:14:47 +0100 Subject: Fix shared imports --- server/lib/activitypub/cache-file.ts | 3 +-- server/lib/activitypub/process/process-create.ts | 4 +--- server/lib/activitypub/process/process-dislike.ts | 3 +-- server/lib/activitypub/process/process-flag.ts | 2 +- server/lib/job-queue/handlers/move-to-object-storage.ts | 2 +- server/lib/job-queue/handlers/video-import.ts | 11 ++++++----- server/lib/job-queue/handlers/video-transcoding.ts | 2 +- 7 files changed, 12 insertions(+), 15 deletions(-) (limited to 'server/lib') diff --git a/server/lib/activitypub/cache-file.ts b/server/lib/activitypub/cache-file.ts index a16d2cd93..c3acd7112 100644 --- a/server/lib/activitypub/cache-file.ts +++ b/server/lib/activitypub/cache-file.ts @@ -1,7 +1,6 @@ import { Transaction } from 'sequelize' import { MActorId, MVideoRedundancy, MVideoWithAllFiles } from '@server/types/models' -import { CacheFileObject } from '../../../shared/index' -import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type' +import { CacheFileObject, VideoStreamingPlaylistType } from '@shared/models' import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy' async function createOrUpdateCacheFile (cacheFileObject: CacheFileObject, video: MVideoWithAllFiles, byActor: MActorId, t: Transaction) { diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 93f1d1c59..3e8ad184c 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts @@ -1,8 +1,6 @@ import { isBlockedByServerOrAccount } from '@server/lib/blocklist' import { isRedundancyAccepted } from '@server/lib/redundancy' -import { ActivityCreate, CacheFileObject, VideoObject } from '../../../../shared' -import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object' -import { VideoCommentObject } from '../../../../shared/models/activitypub/objects/video-comment-object' +import { ActivityCreate, CacheFileObject, PlaylistObject, VideoCommentObject, VideoObject } from '@shared/models' import { retryTransactionWrapper } from '../../../helpers/database-utils' import { logger } from '../../../helpers/logger' import { sequelizeTypescript } from '../../../initializers/database' diff --git a/server/lib/activitypub/process/process-dislike.ts b/server/lib/activitypub/process/process-dislike.ts index ecc57cd10..2f46b83d1 100644 --- a/server/lib/activitypub/process/process-dislike.ts +++ b/server/lib/activitypub/process/process-dislike.ts @@ -1,5 +1,4 @@ -import { ActivityCreate, ActivityDislike } from '../../../../shared' -import { DislikeObject } from '../../../../shared/models/activitypub/objects' +import { ActivityCreate, ActivityDislike, DislikeObject } from '@shared/models' import { retryTransactionWrapper } from '../../../helpers/database-utils' import { sequelizeTypescript } from '../../../initializers/database' import { AccountVideoRateModel } from '../../../models/account/account-video-rate' diff --git a/server/lib/activitypub/process/process-flag.ts b/server/lib/activitypub/process/process-flag.ts index fd3e46e2b..a15d07a62 100644 --- a/server/lib/activitypub/process/process-flag.ts +++ b/server/lib/activitypub/process/process-flag.ts @@ -3,7 +3,7 @@ import { AccountModel } from '@server/models/account/account' import { VideoModel } from '@server/models/video/video' import { VideoCommentModel } from '@server/models/video/video-comment' import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' -import { AbuseObject, AbuseState, ActivityCreate, ActivityFlag } from '../../../../shared' +import { AbuseObject, AbuseState, ActivityCreate, ActivityFlag } from '@shared/models' import { getAPId } from '../../../helpers/activitypub' import { retryTransactionWrapper } from '../../../helpers/database-utils' import { logger } from '../../../helpers/logger' diff --git a/server/lib/job-queue/handlers/move-to-object-storage.ts b/server/lib/job-queue/handlers/move-to-object-storage.ts index d9c415b2d..9e39322a8 100644 --- a/server/lib/job-queue/handlers/move-to-object-storage.ts +++ b/server/lib/job-queue/handlers/move-to-object-storage.ts @@ -11,7 +11,7 @@ import { moveToFailedMoveToObjectStorageState, moveToNextState } from '@server/l import { VideoModel } from '@server/models/video/video' import { VideoJobInfoModel } from '@server/models/video/video-job-info' import { MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoWithAllFiles } from '@server/types/models' -import { MoveObjectStoragePayload, VideoStorage } from '../../../../shared' +import { MoveObjectStoragePayload, VideoStorage } from '@shared/models' export async function processMoveToObjectStorage (job: Job) { const payload = job.data as MoveObjectStoragePayload diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts index beb78b4a6..2f74e9fbd 100644 --- a/server/lib/job-queue/handlers/video-import.ts +++ b/server/lib/job-queue/handlers/video-import.ts @@ -1,6 +1,5 @@ import { Job } from 'bull' import { move, remove, stat } from 'fs-extra' -import { getLowercaseExtension } from '@shared/core-utils' import { retryTransactionWrapper } from '@server/helpers/database-utils' import { YoutubeDLWrapper } from '@server/helpers/youtube-dl' import { isPostImportVideoAccepted } from '@server/lib/moderation' @@ -13,16 +12,19 @@ import { VideoPathManager } from '@server/lib/video-path-manager' import { buildNextVideoState } from '@server/lib/video-state' import { ThumbnailModel } from '@server/models/video/thumbnail' import { MVideoImportDefault, MVideoImportDefaultFiles, MVideoImportVideo } from '@server/types/models/video/video-import' +import { getLowercaseExtension } from '@shared/core-utils' +import { isAudioFile } from '@shared/extra-utils' import { + ThumbnailType, VideoImportPayload, + VideoImportState, VideoImportTorrentPayload, VideoImportTorrentPayloadType, VideoImportYoutubeDLPayload, VideoImportYoutubeDLPayloadType, + VideoResolution, VideoState -} from '../../../../shared' -import { VideoImportState, VideoResolution } from '../../../../shared/models/videos' -import { ThumbnailType } from '../../../../shared/models/videos/thumbnail.type' +} from '@shared/models' import { ffprobePromise, getDurationFromVideoFile, getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffprobe-utils' import { logger } from '../../../helpers/logger' import { getSecureTorrentName } from '../../../helpers/utils' @@ -36,7 +38,6 @@ import { MThumbnail } from '../../../types/models/video/thumbnail' import { federateVideoIfNeeded } from '../../activitypub/videos' import { Notifier } from '../../notifier' import { generateVideoMiniature } from '../../thumbnail' -import { isAudioFile } from '@shared/extra-utils' async function processVideoImport (job: Job) { const payload = job.data as VideoImportPayload diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index 0edcdcba3..ef3abcbcd 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts @@ -12,7 +12,7 @@ import { NewResolutionTranscodingPayload, OptimizeTranscodingPayload, VideoTranscodingPayload -} from '../../../../shared' +} from '@shared/models' import { retryTransactionWrapper } from '../../../helpers/database-utils' import { computeLowerResolutionsToTranscode } from '../../../helpers/ffprobe-utils' import { logger, loggerTagsFactory } from '../../../helpers/logger' -- cgit v1.2.3