|
|
@ -416,7 +416,7 @@ public sealed class RecordingsManager : IRecordingsManager, IDisposable
|
|
|
|
timer.RecordingPath = recordingPath;
|
|
|
|
timer.RecordingPath = recordingPath;
|
|
|
|
timer.Status = RecordingStatus.Completed;
|
|
|
|
timer.Status = RecordingStatus.Completed;
|
|
|
|
_timerManager.AddOrUpdate(timer, false);
|
|
|
|
_timerManager.AddOrUpdate(timer, false);
|
|
|
|
PostProcessRecording(recordingPath);
|
|
|
|
await PostProcessRecording(recordingPath).ConfigureAwait(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -800,7 +800,7 @@ public sealed class RecordingsManager : IRecordingsManager, IDisposable
|
|
|
|
return new DirectRecorder(_logger, _httpClientFactory, _streamHelper);
|
|
|
|
return new DirectRecorder(_logger, _httpClientFactory, _streamHelper);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void PostProcessRecording(string path)
|
|
|
|
private async Task PostProcessRecording(string path)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var options = _config.GetLiveTvConfiguration();
|
|
|
|
var options = _config.GetLiveTvConfiguration();
|
|
|
|
if (string.IsNullOrWhiteSpace(options.RecordingPostProcessor))
|
|
|
|
if (string.IsNullOrWhiteSpace(options.RecordingPostProcessor))
|
|
|
@ -810,9 +810,8 @@ public sealed class RecordingsManager : IRecordingsManager, IDisposable
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var process = new Process
|
|
|
|
using var process = new Process();
|
|
|
|
{
|
|
|
|
process.StartInfo = new ProcessStartInfo
|
|
|
|
StartInfo = new ProcessStartInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Arguments = options.RecordingPostProcessorArguments
|
|
|
|
Arguments = options.RecordingPostProcessorArguments
|
|
|
|
.Replace("{path}", path, StringComparison.OrdinalIgnoreCase),
|
|
|
|
.Replace("{path}", path, StringComparison.OrdinalIgnoreCase),
|
|
|
@ -821,29 +820,19 @@ public sealed class RecordingsManager : IRecordingsManager, IDisposable
|
|
|
|
FileName = options.RecordingPostProcessor,
|
|
|
|
FileName = options.RecordingPostProcessor,
|
|
|
|
WindowStyle = ProcessWindowStyle.Hidden,
|
|
|
|
WindowStyle = ProcessWindowStyle.Hidden,
|
|
|
|
UseShellExecute = false
|
|
|
|
UseShellExecute = false
|
|
|
|
},
|
|
|
|
|
|
|
|
EnableRaisingEvents = true
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
process.EnableRaisingEvents = true;
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("Running recording post processor {0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
|
|
|
_logger.LogInformation("Running recording post processor {0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
|
|
|
|
|
|
|
|
|
|
|
process.Exited += OnProcessExited;
|
|
|
|
|
|
|
|
process.Start();
|
|
|
|
process.Start();
|
|
|
|
|
|
|
|
await process.WaitForExitAsync(CancellationToken.None).ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("Recording post-processing script completed with exit code {ExitCode}", process.ExitCode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.LogError(ex, "Error running recording post processor");
|
|
|
|
_logger.LogError(ex, "Error running recording post processor");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnProcessExited(object? sender, EventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (sender is Process process)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
using (process)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.LogInformation("Recording post-processing script completed with exit code {ExitCode}", process.ExitCode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|