From 690bad52e186a0111359062743d9638b911026f2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 28 Sep 2022 10:03:06 +0200 Subject: Prevent "Cannot use same state" error --- server/lib/video-state.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/lib/video-state.ts b/server/lib/video-state.ts index 9ebbd7679..893725d85 100644 --- a/server/lib/video-state.ts +++ b/server/lib/video-state.ts @@ -82,7 +82,10 @@ async function moveToExternalStorageState (options: { if (pendingTranscode !== 0) return false const previousVideoState = video.state - await video.setNewState(VideoState.TO_MOVE_TO_EXTERNAL_STORAGE, isNewVideo, transaction) + + if (video.state !== VideoState.TO_MOVE_TO_EXTERNAL_STORAGE) { + await video.setNewState(VideoState.TO_MOVE_TO_EXTERNAL_STORAGE, isNewVideo, transaction) + } logger.info('Creating external storage move job for video %s.', video.uuid, { tags: [ video.uuid ] }) -- cgit v1.2.3