diff options
author | Chocobozzz <me@florianbigard.com> | 2022-09-09 09:21:42 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-09-09 09:21:42 +0200 |
commit | e4fc3697acb27c4192cbbb63eb94272a6cf7ce32 (patch) | |
tree | 96daedbbbc030920bae25816dd15a16a8c85fb8f /server/lib/transcoding/transcoding.ts | |
parent | 405c83f9af377a663a4c8e9ad025fd5c10496922 (diff) | |
download | PeerTube-e4fc3697acb27c4192cbbb63eb94272a6cf7ce32.tar.gz PeerTube-e4fc3697acb27c4192cbbb63eb94272a6cf7ce32.tar.zst PeerTube-e4fc3697acb27c4192cbbb63eb94272a6cf7ce32.zip |
Fix saved live master playlist bandwidth
Diffstat (limited to 'server/lib/transcoding/transcoding.ts')
-rw-r--r-- | server/lib/transcoding/transcoding.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/lib/transcoding/transcoding.ts b/server/lib/transcoding/transcoding.ts index 07eee4122..44e26754d 100644 --- a/server/lib/transcoding/transcoding.ts +++ b/server/lib/transcoding/transcoding.ts | |||
@@ -342,6 +342,12 @@ async function generateHlsPlaylistCommon (options: { | |||
342 | // Move video file | 342 | // Move video file |
343 | await move(join(videoTranscodedBasePath, videoFilename), videoFilePath, { overwrite: true }) | 343 | await move(join(videoTranscodedBasePath, videoFilename), videoFilePath, { overwrite: true }) |
344 | 344 | ||
345 | // Update video duration if it was not set (in case of a live for example) | ||
346 | if (!video.duration) { | ||
347 | video.duration = await getVideoStreamDuration(videoFilePath) | ||
348 | await video.save() | ||
349 | } | ||
350 | |||
345 | const stats = await stat(videoFilePath) | 351 | const stats = await stat(videoFilePath) |
346 | 352 | ||
347 | newVideoFile.size = stats.size | 353 | newVideoFile.size = stats.size |