From 4fae2b1f300c1f027629569817262f60873a663a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 28 Jun 2022 14:57:51 +0200 Subject: Rename video full loading --- server/controllers/api/videos/ownership.ts | 2 +- server/controllers/api/videos/update.ts | 4 ++-- server/controllers/api/videos/upload.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/api/videos/ownership.ts b/server/controllers/api/videos/ownership.ts index 043861ac3..88355b289 100644 --- a/server/controllers/api/videos/ownership.ts +++ b/server/controllers/api/videos/ownership.ts @@ -105,7 +105,7 @@ function acceptOwnership (req: express.Request, res: express.Response) { const channel = res.locals.videoChannel // We need more attributes for federation - const targetVideo = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoChangeOwnership.Video.id, t) + const targetVideo = await VideoModel.loadFull(videoChangeOwnership.Video.id, t) const oldVideoChannel = await VideoChannelModel.loadAndPopulateAccount(targetVideo.channelId, t) diff --git a/server/controllers/api/videos/update.ts b/server/controllers/api/videos/update.ts index 2cf8a5883..65a7321fd 100644 --- a/server/controllers/api/videos/update.ts +++ b/server/controllers/api/videos/update.ts @@ -62,7 +62,7 @@ async function updateVideo (req: express.Request, res: express.Response) { try { const { videoInstanceUpdated, isNewVideo } = await sequelizeTypescript.transaction(async t => { // Refresh video since thumbnails to prevent concurrent updates - const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoFromReq.id, t) + const video = await VideoModel.loadFull(videoFromReq.id, t) const sequelizeOptions = { transaction: t } const oldVideoChannel = video.VideoChannel @@ -212,5 +212,5 @@ async function updateTorrentsMetadataIfNeeded (video: MVideoFullLight, videoInfo } // Refresh video since files have changed - return VideoModel.loadAndPopulateAccountAndServerAndTags(video.id) + return VideoModel.loadFull(video.id) } diff --git a/server/controllers/api/videos/upload.ts b/server/controllers/api/videos/upload.ts index c5890691e..3ce66c9ca 100644 --- a/server/controllers/api/videos/upload.ts +++ b/server/controllers/api/videos/upload.ts @@ -272,7 +272,7 @@ async function createTorrentFederate (video: MVideoFullLight, videoFile: MVideoF const job = await JobQueue.Instance.createJobWithPromise({ type: 'manage-video-torrent', payload }) await job.finished() - const refreshedVideo = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.id) + const refreshedVideo = await VideoModel.loadFull(video.id) if (!refreshedVideo) return // Only federate and notify after the torrent creation -- cgit v1.2.3