diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/prune-storage.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index d19594a60..8d1ded59b 100755 --- a/scripts/prune-storage.ts +++ b/scripts/prune-storage.ts | |||
@@ -37,8 +37,8 @@ async function run () { | |||
37 | console.log('Detecting files to remove, it could take a while...') | 37 | console.log('Detecting files to remove, it could take a while...') |
38 | 38 | ||
39 | toDelete = toDelete.concat( | 39 | toDelete = toDelete.concat( |
40 | await pruneDirectory(DIRECTORIES.VIDEOS.PUBLIC, doesWebTorrentFileExist()), | 40 | await pruneDirectory(DIRECTORIES.VIDEOS.PUBLIC, doesWebVideoFileExist()), |
41 | await pruneDirectory(DIRECTORIES.VIDEOS.PRIVATE, doesWebTorrentFileExist()), | 41 | await pruneDirectory(DIRECTORIES.VIDEOS.PRIVATE, doesWebVideoFileExist()), |
42 | 42 | ||
43 | await pruneDirectory(DIRECTORIES.HLS_STREAMING_PLAYLIST.PRIVATE, doesHLSPlaylistExist()), | 43 | await pruneDirectory(DIRECTORIES.HLS_STREAMING_PLAYLIST.PRIVATE, doesHLSPlaylistExist()), |
44 | await pruneDirectory(DIRECTORIES.HLS_STREAMING_PLAYLIST.PUBLIC, doesHLSPlaylistExist()), | 44 | await pruneDirectory(DIRECTORIES.HLS_STREAMING_PLAYLIST.PUBLIC, doesHLSPlaylistExist()), |
@@ -93,12 +93,12 @@ async function pruneDirectory (directory: string, existFun: ExistFun) { | |||
93 | return toDelete | 93 | return toDelete |
94 | } | 94 | } |
95 | 95 | ||
96 | function doesWebTorrentFileExist () { | 96 | function doesWebVideoFileExist () { |
97 | return (filePath: string) => { | 97 | return (filePath: string) => { |
98 | // Don't delete private directory | 98 | // Don't delete private directory |
99 | if (filePath === DIRECTORIES.VIDEOS.PRIVATE) return true | 99 | if (filePath === DIRECTORIES.VIDEOS.PRIVATE) return true |
100 | 100 | ||
101 | return VideoFileModel.doesOwnedWebTorrentVideoFileExist(basename(filePath)) | 101 | return VideoFileModel.doesOwnedWebVideoFileExist(basename(filePath)) |
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||