From 7d9ba5c08999c6482f0bc5e0c09c6f55b7724090 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 May 2021 11:15:29 +0200 Subject: Cleanup models directory organization --- server/lib/job-queue/handlers/activitypub-follow.ts | 20 ++++++++++---------- .../lib/job-queue/handlers/activitypub-refresher.ts | 8 ++++---- server/lib/job-queue/handlers/actor-keys.ts | 2 +- .../handlers/utils/activitypub-http-utils.ts | 8 ++++---- server/lib/job-queue/handlers/video-file-import.ts | 2 +- server/lib/job-queue/handlers/video-transcoding.ts | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) (limited to 'server/lib/job-queue') diff --git a/server/lib/job-queue/handlers/activitypub-follow.ts b/server/lib/job-queue/handlers/activitypub-follow.ts index 82c95be80..ec8df8969 100644 --- a/server/lib/job-queue/handlers/activitypub-follow.ts +++ b/server/lib/job-queue/handlers/activitypub-follow.ts @@ -1,18 +1,18 @@ import * as Bull from 'bull' -import { logger } from '../../../helpers/logger' -import { REMOTE_SCHEME, WEBSERVER } from '../../../initializers/constants' -import { sendFollow } from '../../activitypub/send' +import { getLocalActorFollowActivityPubUrl } from '@server/lib/activitypub/url' +import { ActivitypubFollowPayload } from '@shared/models' import { sanitizeHost } from '../../../helpers/core-utils' -import { loadActorUrlOrGetFromWebfinger } from '../../../helpers/webfinger' -import { getOrCreateActorAndServerAndModel } from '../../activitypub/actor' import { retryTransactionWrapper } from '../../../helpers/database-utils' -import { ActorFollowModel } from '../../../models/activitypub/actor-follow' -import { ActorModel } from '../../../models/activitypub/actor' -import { Notifier } from '../../notifier' +import { logger } from '../../../helpers/logger' +import { loadActorUrlOrGetFromWebfinger } from '../../../helpers/webfinger' +import { REMOTE_SCHEME, WEBSERVER } from '../../../initializers/constants' import { sequelizeTypescript } from '../../../initializers/database' +import { ActorModel } from '../../../models/actor/actor' +import { ActorFollowModel } from '../../../models/actor/actor-follow' import { MActor, MActorFollowActors, MActorFull } from '../../../types/models' -import { ActivitypubFollowPayload } from '@shared/models' -import { getLocalActorFollowActivityPubUrl } from '@server/lib/activitypub/url' +import { getOrCreateActorAndServerAndModel } from '../../activitypub/actor' +import { sendFollow } from '../../activitypub/send' +import { Notifier } from '../../notifier' async function processActivityPubFollow (job: Bull.Job) { const payload = job.data as ActivitypubFollowPayload diff --git a/server/lib/job-queue/handlers/activitypub-refresher.ts b/server/lib/job-queue/handlers/activitypub-refresher.ts index 666e56868..c09b1bcc8 100644 --- a/server/lib/job-queue/handlers/activitypub-refresher.ts +++ b/server/lib/job-queue/handlers/activitypub-refresher.ts @@ -1,12 +1,12 @@ import * as Bull from 'bull' +import { refreshVideoPlaylistIfNeeded } from '@server/lib/activitypub/playlist' +import { RefreshPayload } from '@shared/models' import { logger } from '../../../helpers/logger' import { fetchVideoByUrl } from '../../../helpers/video' +import { ActorModel } from '../../../models/actor/actor' +import { VideoPlaylistModel } from '../../../models/video/video-playlist' import { refreshActorIfNeeded } from '../../activitypub/actor' import { refreshVideoIfNeeded } from '../../activitypub/videos' -import { ActorModel } from '../../../models/activitypub/actor' -import { VideoPlaylistModel } from '../../../models/video/video-playlist' -import { RefreshPayload } from '@shared/models' -import { refreshVideoPlaylistIfNeeded } from '@server/lib/activitypub/playlist' async function refreshAPObject (job: Bull.Job) { const payload = job.data as RefreshPayload diff --git a/server/lib/job-queue/handlers/actor-keys.ts b/server/lib/job-queue/handlers/actor-keys.ts index 125307843..3eef565d0 100644 --- a/server/lib/job-queue/handlers/actor-keys.ts +++ b/server/lib/job-queue/handlers/actor-keys.ts @@ -1,6 +1,6 @@ import * as Bull from 'bull' import { generateAndSaveActorKeys } from '@server/lib/activitypub/actor' -import { ActorModel } from '@server/models/activitypub/actor' +import { ActorModel } from '@server/models/actor/actor' import { ActorKeysPayload } from '@shared/models' import { logger } from '../../../helpers/logger' diff --git a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts index e8a91450d..37e7c1fad 100644 --- a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts +++ b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts @@ -1,10 +1,10 @@ +import { buildDigest } from '@server/helpers/peertube-crypto' +import { getServerActor } from '@server/models/application/application' +import { ContextType } from '@shared/models/activitypub/context' import { buildSignedActivity } from '../../../../helpers/activitypub' -import { ActorModel } from '../../../../models/activitypub/actor' import { ACTIVITY_PUB, HTTP_SIGNATURE } from '../../../../initializers/constants' +import { ActorModel } from '../../../../models/actor/actor' import { MActor } from '../../../../types/models' -import { getServerActor } from '@server/models/application/application' -import { buildDigest } from '@server/helpers/peertube-crypto' -import { ContextType } from '@shared/models/activitypub/context' type Payload = { body: T, contextType?: ContextType, signatureActorId?: number } diff --git a/server/lib/job-queue/handlers/video-file-import.ts b/server/lib/job-queue/handlers/video-file-import.ts index 71f2cafcd..8297a1571 100644 --- a/server/lib/job-queue/handlers/video-file-import.ts +++ b/server/lib/job-queue/handlers/video-file-import.ts @@ -3,7 +3,7 @@ import { copy, stat } from 'fs-extra' import { extname } from 'path' import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths' -import { UserModel } from '@server/models/account/user' +import { UserModel } from '@server/models/user/user' import { MVideoFullLight } from '@server/types/models' import { VideoFileImportPayload } from '@shared/models' import { getVideoFileFPS, getVideoFileResolution } from '../../../helpers/ffprobe-utils' diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.ts index e31bc82f5..8d659daa6 100644 --- a/server/lib/job-queue/handlers/video-transcoding.ts +++ b/server/lib/job-queue/handlers/video-transcoding.ts @@ -2,7 +2,7 @@ import * as Bull from 'bull' import { TranscodeOptionsType } from '@server/helpers/ffmpeg-utils' import { getTranscodingJobPriority, publishAndFederateIfNeeded } from '@server/lib/video' import { getVideoFilePath } from '@server/lib/video-paths' -import { UserModel } from '@server/models/account/user' +import { UserModel } from '@server/models/user/user' import { MUser, MUserId, MVideoFullLight, MVideoUUID, MVideoWithFile } from '@server/types/models' import { HLSTranscodingPayload, -- cgit v1.2.3