aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-17 16:04:53 +0100
committerChocobozzz <me@florianbigard.com>2021-11-18 09:04:30 +0100
commitb46cf4b920984492df598c1b61179acfc7f6f22e (patch)
tree21fda049c85be48ab3d37b537aafa98e94649ad7 /server/models
parent3cfa817672657df18260ece5b354efa0f3b6e317 (diff)
downloadPeerTube-b46cf4b920984492df598c1b61179acfc7f6f22e.tar.gz
PeerTube-b46cf4b920984492df598c1b61179acfc7f6f22e.tar.zst
PeerTube-b46cf4b920984492df598c1b61179acfc7f6f22e.zip
Add ability to remove hls/webtorrent files
Diffstat (limited to 'server/models')
-rw-r--r--server/models/redundancy/video-redundancy.ts2
-rw-r--r--server/models/video/video.ts4
2 files changed, 3 insertions, 3 deletions
diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts
index 529977924..e8d79a3ab 100644
--- a/server/models/redundancy/video-redundancy.ts
+++ b/server/models/redundancy/video-redundancy.ts
@@ -160,7 +160,7 @@ export class VideoRedundancyModel extends Model<Partial<AttributesOnly<VideoRedu
160 const logIdentifier = `${videoFile.Video.uuid}-${videoFile.resolution}` 160 const logIdentifier = `${videoFile.Video.uuid}-${videoFile.resolution}`
161 logger.info('Removing duplicated video file %s.', logIdentifier) 161 logger.info('Removing duplicated video file %s.', logIdentifier)
162 162
163 videoFile.Video.removeFileAndTorrent(videoFile, true) 163 videoFile.Video.removeWebTorrentFileAndTorrent(videoFile, true)
164 .catch(err => logger.error('Cannot delete %s files.', logIdentifier, { err })) 164 .catch(err => logger.error('Cannot delete %s files.', logIdentifier, { err }))
165 } 165 }
166 166
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 69d009e04..6eeb6b312 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -746,7 +746,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
746 746
747 // Remove physical files and torrents 747 // Remove physical files and torrents
748 instance.VideoFiles.forEach(file => { 748 instance.VideoFiles.forEach(file => {
749 tasks.push(instance.removeFileAndTorrent(file)) 749 tasks.push(instance.removeWebTorrentFileAndTorrent(file))
750 }) 750 })
751 751
752 // Remove playlists file 752 // Remove playlists file
@@ -1706,7 +1706,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
1706 .concat(toAdd) 1706 .concat(toAdd)
1707 } 1707 }
1708 1708
1709 removeFileAndTorrent (videoFile: MVideoFile, isRedundancy = false) { 1709 removeWebTorrentFileAndTorrent (videoFile: MVideoFile, isRedundancy = false) {
1710 const filePath = isRedundancy 1710 const filePath = isRedundancy
1711 ? VideoPathManager.Instance.getFSRedundancyVideoFilePath(this, videoFile) 1711 ? VideoPathManager.Instance.getFSRedundancyVideoFilePath(this, videoFile)
1712 : VideoPathManager.Instance.getFSVideoFileOutputPath(this, videoFile) 1712 : VideoPathManager.Instance.getFSVideoFileOutputPath(this, videoFile)