From abcf9c4819f241be7c80102d7cc80f3b3b27eae2 Mon Sep 17 00:00:00 2001 From: Dominik Date: Mon, 14 Nov 2022 14:45:42 +0100 Subject: [PATCH] Simplify HLS file deletion Co-authored-by: Claus Vium --- Jellyfin.Api/Controllers/DynamicHlsController.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs index 556057a0fd..8c385761b2 100644 --- a/Jellyfin.Api/Controllers/DynamicHlsController.cs +++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs @@ -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) {