The Free Software Media System - Server Backend & API
Apply suggestions from code review
nyanmisaka47a77974b8a8
diff --git a/MediaBrowser.Controller/MediaEncoding/TranscodingSegmentCleaner.cs b/MediaBrowser.Controller/MediaEncoding/TranscodingSegmentCleaner.csindex d18f26b8b2..a6d812873f 100644--- a/MediaBrowser.Controller/MediaEncoding/TranscodingSegmentCleaner.cs+++ b/MediaBrowser.Controller/MediaEncoding/TranscodingSegmentCleaner.cs@@ -23,7 +23,6 @@ public class TranscodingSegmentCleaner : IDisposableprivate readonly IMediaEncoder _mediaEncoder;private Timer? _timer;private int _segmentLength;- private List<string>? _excludeFilePaths;/// <summary>/// Initializes a new instance of the <see cref="TranscodingSegmentCleaner"/> class.@@ -42,7 +41,6 @@ public class TranscodingSegmentCleaner : IDisposable_fileSystem = fileSystem;_mediaEncoder = mediaEncoder;_segmentLength = segmentLength;- _excludeFilePaths = null;}/// <summary>@@ -133,7 +131,7 @@ public class TranscodingSegmentCleaner : IDisposable}catch (Exception ex){- _logger.LogError(ex, "Error deleting segment file(s) {Path}", path);+ _logger.LogDebug(ex, "Error deleting segment file(s) {Path}", path);}}@@ -145,8 +143,7 @@ public class TranscodingSegmentCleaner : IDisposablevar name = Path.GetFileNameWithoutExtension(outputFilePath);var filesToDelete = _fileSystem.GetFilePaths(directory)- .Where(f => (!_excludeFilePaths?.Contains(f) ?? true)- && long.TryParse(Path.GetFileNameWithoutExtension(f).Replace(name, string.Empty, StringComparison.Ordinal), out var idx)+ .Where(f => long.TryParse(Path.GetFileNameWithoutExtension(f).Replace(name, string.Empty, StringComparison.Ordinal), out var idx)&& (idx >= idxMin && idx <= idxMax));List<Exception>? exs = null;@@ -160,8 +157,7 @@ public class TranscodingSegmentCleaner : IDisposablecatch (IOException ex){(exs ??= new List<Exception>(4)).Add(ex);- (_excludeFilePaths ??= new List<string>()).Add(file);- _logger.LogError(ex, "Error deleting HLS segment file {Path}", file);+ _logger.LogDebug(ex, "Error deleting HLS segment file {Path}", file);}}