diff options
Diffstat (limited to 'scripts/prune-storage.ts')
-rwxr-xr-x | scripts/prune-storage.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/prune-storage.ts b/scripts/prune-storage.ts index d19594a60..9a73a8600 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()), |
@@ -50,7 +50,7 @@ async function run () { | |||
50 | await pruneDirectory(CONFIG.STORAGE.PREVIEWS_DIR, doesThumbnailExist(true, ThumbnailType.PREVIEW)), | 50 | await pruneDirectory(CONFIG.STORAGE.PREVIEWS_DIR, doesThumbnailExist(true, ThumbnailType.PREVIEW)), |
51 | await pruneDirectory(CONFIG.STORAGE.THUMBNAILS_DIR, doesThumbnailExist(false, ThumbnailType.MINIATURE)), | 51 | await pruneDirectory(CONFIG.STORAGE.THUMBNAILS_DIR, doesThumbnailExist(false, ThumbnailType.MINIATURE)), |
52 | 52 | ||
53 | await pruneDirectory(CONFIG.STORAGE.ACTOR_IMAGES, doesActorImageExist) | 53 | await pruneDirectory(CONFIG.STORAGE.ACTOR_IMAGES_DIR, doesActorImageExist) |
54 | ) | 54 | ) |
55 | 55 | ||
56 | const tmpFiles = await readdir(CONFIG.STORAGE.TMP_DIR) | 56 | const tmpFiles = await readdir(CONFIG.STORAGE.TMP_DIR) |
@@ -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 | ||