X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fprune-storage.ts;h=2b04e906d999ba4d1ffb54148724f33ce1bb6ab5;hb=64ffd1deb2abd412b9b45f473e8ba6d2c0dbfb79;hp=df4bdeebe0c2b18f01694cfe899993e8b8070331;hpb=40b8906957719bf8ece5d5f8179136bc604dbf84;p=github%2FChocobozzz%2FPeerTube.git diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index df4bdeebe..2b04e906d 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts @@ -1,8 +1,11 @@ +import { registerTSPaths } from '../server/helpers/register-ts-paths' +registerTSPaths() + 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' @@ -131,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 }