X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fprune-storage.ts;h=1def1d792f882d7098445c07f9420d15bbb4c02e;hb=3b01f4c0ac764ecb70efaadfd939ca868c28769c;hp=c8968013b8dbfd0573c17af4d35d73013aa6bcf9;hpb=2aaa1a3fdc49be77aec5309dab5507865c38d392;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index c8968013b..1def1d792 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts @@ -5,7 +5,7 @@ import * as prompt from 'prompt' import { join } from 'path' import { CONFIG } from '../server/initializers/config' import { VideoModel } from '../server/models/video/video' -import { initDatabaseModels } from '../server/initializers' +import { initDatabaseModels } from '../server/initializers/database' import { readdir, remove } from 'fs-extra' import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy' import * as Bluebird from 'bluebird' @@ -134,9 +134,9 @@ async function doesRedundancyExist (file: string) { return true } - const videoFile = video.getFile(resolution) + const videoFile = video.getWebTorrentFile(resolution) if (!videoFile) { - console.error('Cannot find file of video %s - %d', video.url, resolution) + console.error('Cannot find webtorrent file of video %s - %d', video.url, resolution) return true } @@ -161,7 +161,8 @@ async function askConfirmation () { } prompt.get(schema, function (err, result) { if (err) return rej(err) - return res(result.confirm && result.confirm.match(/y/) !== null) + + return res(result.confirm?.match(/y/) !== null) }) }) }