The Free Software Media System - Server Backend & API
Make IRecorder an IDisposable
Patrick Barron669baf98a577
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.csindex ec4dbde30d..ddf7b882a7 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/DirectRecorder.cs@@ -14,7 +14,7 @@ using Microsoft.Extensions.Logging;namespace Emby.Server.Implementations.LiveTv.EmbyTV{- public class DirectRecorder : IRecorder+ public sealed class DirectRecorder : IRecorder{private readonly ILogger _logger;private readonly IHttpClientFactory _httpClientFactory;@@ -109,5 +109,10 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV_logger.LogInformation("Recording completed to file {0}", targetFile);}}++ /// <inheritdoc />+ public void Dispose()+ {+ }}}diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.csindex cba24ca459..abe3ff349f 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs@@ -1269,7 +1269,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTVdirectStreamProvider = liveStreamResponse.Item2;}- var recorder = GetRecorder(mediaStreamInfo);+ using var recorder = GetRecorder(mediaStreamInfo);recordPath = recorder.GetOutputPath(mediaStreamInfo, recordPath);recordPath = EnsureFileUnique(recordPath, timer.Id);diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.csindex b548a92b19..9a9fd02739 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs@@ -25,7 +25,7 @@ using Microsoft.Extensions.Logging;namespace Emby.Server.Implementations.LiveTv.EmbyTV{- public class EncodedRecorder : IRecorder, IDisposable+ public class EncodedRecorder : IRecorder{private readonly ILogger _logger;private readonly IMediaEncoder _mediaEncoder;@@ -37,7 +37,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTVprivate FileStream _logFileStream;private string _targetPath;private Process _process;- private bool _disposed = false;+ private bool _disposed;public EncodedRecorder(ILogger logger,diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/IRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/IRecorder.csindex 7705132da2..de14d6d086 100644--- a/Emby.Server.Implementations/LiveTv/EmbyTV/IRecorder.cs+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/IRecorder.cs@@ -8,7 +8,7 @@ using MediaBrowser.Model.Dto;namespace Emby.Server.Implementations.LiveTv.EmbyTV{- public interface IRecorder+ public interface IRecorder : IDisposable{/// <summary>/// Records the specified media source.