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:
parent
bd60f178af
commit
b2bb45cf91
4 changed files with 193 additions and 165 deletions
|
@ -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 })
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue