1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Fix broken object storage playlist on file removal

This commit is contained in:
Chocobozzz 2024-08-19 16:00:40 +02:00
parent bd60f178af
commit b2bb45cf91
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 193 additions and 165 deletions

View file

@ -62,14 +62,13 @@ async function storeObject (options: {
async function storeContent (options: {
content: string
inputPath: string
objectStorageKey: string
bucketInfo: BucketInfo
isPrivate: boolean
}): Promise<string> {
const { content, objectStorageKey, bucketInfo, inputPath, isPrivate } = options
const { content, objectStorageKey, bucketInfo, isPrivate } = options
logger.debug('Uploading %s content to %s%s in bucket %s', inputPath, bucketInfo.PREFIX, objectStorageKey, bucketInfo.BUCKET_NAME, lTags())
logger.debug('Uploading %s content to %s%s in bucket %s', content, bucketInfo.PREFIX, objectStorageKey, bucketInfo.BUCKET_NAME, lTags())
return uploadToStorage({ objectStorageKey, content, bucketInfo, isPrivate })
}

View file

@ -49,11 +49,10 @@ export function storeHLSFileFromPath (playlist: MStreamingPlaylistVideo, path: s
})
}
export function storeHLSFileFromContent (playlist: MStreamingPlaylistVideo, path: string, content: string) {
export function storeHLSFileFromContent (playlist: MStreamingPlaylistVideo, pathOrFilename: string, content: string) {
return storeContent({
content,
inputPath: path,
objectStorageKey: generateHLSObjectStorageKey(playlist, basename(path)),
objectStorageKey: generateHLSObjectStorageKey(playlist, basename(pathOrFilename)),
bucketInfo: CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS,
isPrivate: playlist.Video.hasPrivateStaticPath()
})