diff options
author | Chocobozzz <me@florianbigard.com> | 2022-10-25 14:18:59 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-10-25 14:18:59 +0200 |
commit | aa887096f9a305568dc3a846d0c9cdf7e45f1c67 (patch) | |
tree | 5dc455d680ebdd24644ebe29b2f129afb903b421 /server/models | |
parent | 508c1b1e9f3b26752a961e945b7fa59b72b30827 (diff) | |
download | PeerTube-aa887096f9a305568dc3a846d0c9cdf7e45f1c67.tar.gz PeerTube-aa887096f9a305568dc3a846d0c9cdf7e45f1c67.tar.zst PeerTube-aa887096f9a305568dc3a846d0c9cdf7e45f1c67.zip |
Correctly delete live files from object storage
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 9399712b8..2ff92cbf1 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -26,7 +26,7 @@ import { | |||
26 | } from 'sequelize-typescript' | 26 | } from 'sequelize-typescript' |
27 | import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video' | 27 | import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video' |
28 | import { LiveManager } from '@server/lib/live/live-manager' | 28 | import { LiveManager } from '@server/lib/live/live-manager' |
29 | import { removeHLSFileObjectStorage, removeHLSObjectStorage, removeWebTorrentObjectStorage } from '@server/lib/object-storage' | 29 | import { removeHLSFileObjectStorageByFilename, removeHLSObjectStorage, removeWebTorrentObjectStorage } from '@server/lib/object-storage' |
30 | import { tracer } from '@server/lib/opentelemetry/tracing' | 30 | import { tracer } from '@server/lib/opentelemetry/tracing' |
31 | import { getHLSDirectory, getHLSRedundancyDirectory, getHlsResolutionPlaylistFilename } from '@server/lib/paths' | 31 | import { getHLSDirectory, getHLSRedundancyDirectory, getHlsResolutionPlaylistFilename } from '@server/lib/paths' |
32 | import { VideoPathManager } from '@server/lib/video-path-manager' | 32 | import { VideoPathManager } from '@server/lib/video-path-manager' |
@@ -1830,8 +1830,8 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1830 | await remove(VideoPathManager.Instance.getFSHLSOutputPath(this, resolutionFilename)) | 1830 | await remove(VideoPathManager.Instance.getFSHLSOutputPath(this, resolutionFilename)) |
1831 | 1831 | ||
1832 | if (videoFile.storage === VideoStorage.OBJECT_STORAGE) { | 1832 | if (videoFile.storage === VideoStorage.OBJECT_STORAGE) { |
1833 | await removeHLSFileObjectStorage(streamingPlaylist.withVideo(this), videoFile.filename) | 1833 | await removeHLSFileObjectStorageByFilename(streamingPlaylist.withVideo(this), videoFile.filename) |
1834 | await removeHLSFileObjectStorage(streamingPlaylist.withVideo(this), resolutionFilename) | 1834 | await removeHLSFileObjectStorageByFilename(streamingPlaylist.withVideo(this), resolutionFilename) |
1835 | } | 1835 | } |
1836 | } | 1836 | } |
1837 | 1837 | ||
@@ -1840,7 +1840,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1840 | await remove(filePath) | 1840 | await remove(filePath) |
1841 | 1841 | ||
1842 | if (streamingPlaylist.storage === VideoStorage.OBJECT_STORAGE) { | 1842 | if (streamingPlaylist.storage === VideoStorage.OBJECT_STORAGE) { |
1843 | await removeHLSFileObjectStorage(streamingPlaylist.withVideo(this), filename) | 1843 | await removeHLSFileObjectStorageByFilename(streamingPlaylist.withVideo(this), filename) |
1844 | } | 1844 | } |
1845 | } | 1845 | } |
1846 | 1846 | ||