From e94fc29706cd8e8fd892182d4de0a3ae80a3820f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 18 Jun 2018 10:24:53 +0200 Subject: Fix removing scheduled update --- server/controllers/api/videos/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/controllers/api/videos') diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 79ca4699f..ca800a9a8 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -342,10 +342,12 @@ async function updateVideo (req: express.Request, res: express.Response) { updateAt: videoInfoToUpdate.scheduleUpdate.updateAt, privacy: videoInfoToUpdate.scheduleUpdate.privacy || null }, { transaction: t }) + } else if (videoInfoToUpdate.scheduleUpdate === null) { + await ScheduleVideoUpdateModel.deleteByVideoId(videoInstanceUpdated.id, t) } const isNewVideo = wasPrivateVideo && videoInstanceUpdated.privacy !== VideoPrivacy.PRIVATE - await federateVideoIfNeeded(videoInstanceUpdated, isNewVideo) + await federateVideoIfNeeded(videoInstanceUpdated, isNewVideo, t) }) logger.info('Video with name %s and uuid %s updated.', videoInstance.name, videoInstance.uuid) -- cgit v1.2.3