diff options
| author | Anthony Lavado <anthonylavado@users.noreply.github.com> | 2019-08-29 15:55:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-29 15:55:31 -0400 |
| commit | a30876c3ff80323975c67447dff8ff4b4add4637 (patch) | |
| tree | 96bd4da038070cfe160874dccc4d9a5204a07d3f | |
| parent | 503ab56a59bcd55be6f5ad4415fdda97dc607e0a (diff) | |
| parent | 0aaaaab7a0a1d4931bf59ea757761cfe0af7f441 (diff) | |
Merge pull request #1685 from Bond-009/format
Fix invalid arg for
| -rw-r--r-- | Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index 9a9bae215..75efa7ec8 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -309,44 +309,26 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV { _hasExited = true; - DisposeLogStream(); + _logFileStream?.Dispose(); + _logFileStream = null; - try - { - var exitCode = process.ExitCode; + var exitCode = process.ExitCode; - _logger.LogInformation("FFMpeg recording exited with code {ExitCode} for {path}", exitCode, _targetPath); + _logger.LogInformation("FFMpeg recording exited with code {ExitCode} for {Path}", exitCode, _targetPath); - if (exitCode == 0) - { - _taskCompletionSource.TrySetResult(true); - } - else - { - _taskCompletionSource.TrySetException(new Exception(string.Format("Recording for {path} failed. Exit code {ExitCode}", _targetPath, exitCode))); - } - } - catch + if (exitCode == 0) { - _logger.LogError("FFMpeg recording exited with an error for {path}.", _targetPath); - _taskCompletionSource.TrySetException(new Exception(string.Format("Recording for {path} failed", _targetPath))); + _taskCompletionSource.TrySetResult(true); } - } - - private void DisposeLogStream() - { - if (_logFileStream != null) + else { - try - { - _logFileStream.Dispose(); - } - catch (Exception ex) - { - _logger.LogError(ex, "Error disposing recording log stream"); - } - - _logFileStream = null; + _taskCompletionSource.TrySetException( + new Exception( + string.Format( + CultureInfo.InvariantCulture, + "Recording for {0} failed. Exit code {1}", + _targetPath, + exitCode))); } } |
