diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/videos/ownership.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/update.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/videos/upload.ts | 2 |
3 files changed, 4 insertions, 4 deletions
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) { | |||
105 | const channel = res.locals.videoChannel | 105 | const channel = res.locals.videoChannel |
106 | 106 | ||
107 | // We need more attributes for federation | 107 | // We need more attributes for federation |
108 | const targetVideo = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoChangeOwnership.Video.id, t) | 108 | const targetVideo = await VideoModel.loadFull(videoChangeOwnership.Video.id, t) |
109 | 109 | ||
110 | const oldVideoChannel = await VideoChannelModel.loadAndPopulateAccount(targetVideo.channelId, t) | 110 | const oldVideoChannel = await VideoChannelModel.loadAndPopulateAccount(targetVideo.channelId, t) |
111 | 111 | ||
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) { | |||
62 | try { | 62 | try { |
63 | const { videoInstanceUpdated, isNewVideo } = await sequelizeTypescript.transaction(async t => { | 63 | const { videoInstanceUpdated, isNewVideo } = await sequelizeTypescript.transaction(async t => { |
64 | // Refresh video since thumbnails to prevent concurrent updates | 64 | // Refresh video since thumbnails to prevent concurrent updates |
65 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoFromReq.id, t) | 65 | const video = await VideoModel.loadFull(videoFromReq.id, t) |
66 | 66 | ||
67 | const sequelizeOptions = { transaction: t } | 67 | const sequelizeOptions = { transaction: t } |
68 | const oldVideoChannel = video.VideoChannel | 68 | const oldVideoChannel = video.VideoChannel |
@@ -212,5 +212,5 @@ async function updateTorrentsMetadataIfNeeded (video: MVideoFullLight, videoInfo | |||
212 | } | 212 | } |
213 | 213 | ||
214 | // Refresh video since files have changed | 214 | // Refresh video since files have changed |
215 | return VideoModel.loadAndPopulateAccountAndServerAndTags(video.id) | 215 | return VideoModel.loadFull(video.id) |
216 | } | 216 | } |
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 | |||
272 | const job = await JobQueue.Instance.createJobWithPromise({ type: 'manage-video-torrent', payload }) | 272 | const job = await JobQueue.Instance.createJobWithPromise({ type: 'manage-video-torrent', payload }) |
273 | await job.finished() | 273 | await job.finished() |
274 | 274 | ||
275 | const refreshedVideo = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.id) | 275 | const refreshedVideo = await VideoModel.loadFull(video.id) |
276 | if (!refreshedVideo) return | 276 | if (!refreshedVideo) return |
277 | 277 | ||
278 | // Only federate and notify after the torrent creation | 278 | // Only federate and notify after the torrent creation |