Simplify HLS file deletion

Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
This commit is contained in:
Dominik 2022-11-14 14:45:42 +01:00 committed by GitHub
parent 9f4f76b0ab
commit abcf9c4819
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 10 deletions

View File

@ -1503,17 +1503,10 @@ namespace Jellyfin.Api.Controllers
// If the playlist doesn't already exist, startup ffmpeg
try
{
if (_encodingOptions.EnableThrottling && _encodingOptions.EnableSegmentDeletion)
{
// Delete old HLS files when segment deletion is active since ffmpeg doesn't clean them up by itself
await _transcodingJobHelper.KillTranscodingJobs(streamingRequest.DeviceId, streamingRequest.PlaySessionId, p => true)
// Delete old HLS files when segment deletion is active since ffmpeg doesn't clean them up by itself
var deleteFiles = _encodingOptions.EnableThrottling && _encodingOptions.EnableSegmentDeletion;
await _transcodingJobHelper.KillTranscodingJobs(streamingRequest.DeviceId, streamingRequest.PlaySessionId, _ => deleteFiles)
.ConfigureAwait(false);
}
else
{
await _transcodingJobHelper.KillTranscodingJobs(streamingRequest.DeviceId, streamingRequest.PlaySessionId, p => false)
.ConfigureAwait(false);
}
if (currentTranscodingIndex.HasValue)
{