diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/create-move-video-storage-job.ts | 7 |
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() | |||
4 | import { program } from 'commander' | 4 | import { program } from 'commander' |
5 | import { VideoModel } from '@server/models/video/video' | 5 | import { VideoModel } from '@server/models/video/video' |
6 | import { initDatabaseModels } from '@server/initializers/database' | 6 | import { initDatabaseModels } from '@server/initializers/database' |
7 | import { VideoStorage } from '@shared/models' | 7 | import { VideoState, VideoStorage } from '@shared/models' |
8 | import { moveToExternalStorageState } from '@server/lib/video-state' | 8 | import { moveToExternalStorageState } from '@server/lib/video-state' |
9 | import { JobQueue } from '@server/lib/job-queue' | 9 | import { JobQueue } from '@server/lib/job-queue' |
10 | import { CONFIG } from '@server/initializers/config' | 10 | import { 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() |