aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/prune-storage.ts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/prune-storage.ts')
-rwxr-xr-xscripts/prune-storage.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts
index 5b029d215..00141fec1 100755
--- a/scripts/prune-storage.ts
+++ b/scripts/prune-storage.ts
@@ -1,14 +1,14 @@
1import { registerTSPaths } from '../server/helpers/register-ts-paths' 1import { registerTSPaths } from '../server/helpers/register-ts-paths'
2registerTSPaths() 2registerTSPaths()
3 3
4import * as prompt from 'prompt' 4import { start, get } from 'prompt'
5import { join, basename } from 'path' 5import { join, basename } from 'path'
6import { CONFIG } from '../server/initializers/config' 6import { CONFIG } from '../server/initializers/config'
7import { VideoModel } from '../server/models/video/video' 7import { VideoModel } from '../server/models/video/video'
8import { initDatabaseModels } from '../server/initializers/database' 8import { initDatabaseModels } from '../server/initializers/database'
9import { readdir, remove, stat } from 'fs-extra' 9import { readdir, remove, stat } from 'fs-extra'
10import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy' 10import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy'
11import * as Bluebird from 'bluebird' 11import { map } from 'bluebird'
12import { getUUIDFromFilename } from '../server/helpers/utils' 12import { getUUIDFromFilename } from '../server/helpers/utils'
13import { ThumbnailModel } from '../server/models/video/thumbnail' 13import { ThumbnailModel } from '../server/models/video/thumbnail'
14import { ActorImageModel } from '../server/models/actor/actor-image' 14import { ActorImageModel } from '../server/models/actor/actor-image'
@@ -78,7 +78,7 @@ async function pruneDirectory (directory: string, existFun: ExistFun) {
78 const files = await readdir(directory) 78 const files = await readdir(directory)
79 79
80 const toDelete: string[] = [] 80 const toDelete: string[] = []
81 await Bluebird.map(files, async file => { 81 await map(files, async file => {
82 const filePath = join(directory, file) 82 const filePath = join(directory, file)
83 83
84 if (await existFun(filePath) !== true) { 84 if (await existFun(filePath) !== true) {
@@ -141,7 +141,7 @@ async function doesRedundancyExist (filePath: string) {
141 141
142async function askConfirmation () { 142async function askConfirmation () {
143 return new Promise((res, rej) => { 143 return new Promise((res, rej) => {
144 prompt.start() 144 start()
145 const schema = { 145 const schema = {
146 properties: { 146 properties: {
147 confirm: { 147 confirm: {
@@ -154,7 +154,7 @@ async function askConfirmation () {
154 } 154 }
155 } 155 }
156 } 156 }
157 prompt.get(schema, function (err, result) { 157 get(schema, function (err, result) {
158 if (err) return rej(err) 158 if (err) return rej(err)
159 159
160 return res(result.confirm?.match(/y/) !== null) 160 return res(result.confirm?.match(/y/) !== null)