aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-11 09:21:13 +0200
committerChocobozzz <me@florianbigard.com>2023-07-11 09:21:13 +0200
commit784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428 (patch)
tree29c46cfd6344065eb805680ed080cb05592ee1d4 /scripts
parentc3030e944ad03c7fd7b5d668a2d88ff03e4cdf19 (diff)
downloadPeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.gz
PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.zst
PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.zip
Prefer web videos in favour of webtorrent
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/prune-storage.ts8
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
96function doesWebTorrentFileExist () { 96function 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