]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/video-state.ts
Merge branch 'release/5.0.0' into develop
[github/Chocobozzz/PeerTube.git] / server / lib / video-state.ts
index 9ebbd76796a2e78b06ba7b41e55b3b10834f7335..893725d85012f674b96d7274574c66c2d37d26d5 100644 (file)
@@ -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 ] })