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

Fix saved live master playlist bandwidth

This commit is contained in:
Chocobozzz 2022-09-09 09:21:42 +02:00
parent 405c83f9af
commit e4fc3697ac
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 10 additions and 12 deletions

View file

@ -342,6 +342,12 @@ async function generateHlsPlaylistCommon (options: {
// Move video file
await move(join(videoTranscodedBasePath, videoFilename), videoFilePath, { overwrite: true })
// Update video duration if it was not set (in case of a live for example)
if (!video.duration) {
video.duration = await getVideoStreamDuration(videoFilePath)
await video.save()
}
const stats = await stat(videoFilePath)
newVideoFile.size = stats.size