aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/create-move-video-storage-job.ts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/create-move-video-storage-job.ts')
-rw-r--r--scripts/create-move-video-storage-job.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/create-move-video-storage-job.ts b/scripts/create-move-video-storage-job.ts
index 699487f72..90c84b1d7 100644
--- a/scripts/create-move-video-storage-job.ts
+++ b/scripts/create-move-video-storage-job.ts
@@ -4,7 +4,7 @@ registerTSPaths()
4import { program } from 'commander' 4import { program } from 'commander'
5import { VideoModel } from '@server/models/video/video' 5import { VideoModel } from '@server/models/video/video'
6import { initDatabaseModels } from '@server/initializers/database' 6import { initDatabaseModels } from '@server/initializers/database'
7import { VideoStorage } from '@shared/models' 7import { VideoState, VideoStorage } from '@shared/models'
8import { moveToExternalStorageState } from '@server/lib/video-state' 8import { moveToExternalStorageState } from '@server/lib/video-state'
9import { JobQueue } from '@server/lib/job-queue' 9import { JobQueue } from '@server/lib/job-queue'
10import { CONFIG } from '@server/initializers/config' 10import { CONFIG } from '@server/initializers/config'
@@ -62,6 +62,11 @@ async function run () {
62 process.exit(-1) 62 process.exit(-1)
63 } 63 }
64 64
65 if (video.state === VideoState.TO_MOVE_TO_EXTERNAL_STORAGE) {
66 console.error('This video is already being moved to external storage')
67 process.exit(-1)
68 }
69
65 ids.push(video.id) 70 ids.push(video.id)
66 } else { 71 } else {
67 ids = await VideoModel.listLocalIds() 72 ids = await VideoModel.listLocalIds()