Use a separate line for each property initializer
This commit is contained in:
parent
3d8501e462
commit
7152b55747
|
@ -1700,13 +1700,16 @@ namespace Emby.Server.Implementations
|
|||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
var processStartInfo = new ProcessStartInfo
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = url,
|
||||
UseShellExecute = true,
|
||||
ErrorDialog = false
|
||||
},
|
||||
EnableRaisingEvents = true
|
||||
};
|
||||
var process = new Process { StartInfo = processStartInfo, EnableRaisingEvents = true };
|
||||
process.Exited += (sender, args) => ((Process)sender).Dispose();
|
||||
|
||||
try
|
||||
|
|
|
@ -1680,7 +1680,9 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
|
||||
try
|
||||
{
|
||||
var processStartInfo = new ProcessStartInfo
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
Arguments = GetPostProcessArguments(path, options.RecordingPostProcessorArguments),
|
||||
CreateNoWindow = true,
|
||||
|
@ -1688,8 +1690,9 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
FileName = options.RecordingPostProcessor,
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
UseShellExecute = false
|
||||
},
|
||||
EnableRaisingEvents = true
|
||||
};
|
||||
var process = new Process { StartInfo = processStartInfo, EnableRaisingEvents = true };
|
||||
|
||||
_logger.LogInformation("Running recording post processor {0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
|
||||
|
|
|
@ -90,9 +90,8 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
ErrorDialog = false
|
||||
};
|
||||
_process = new Process { StartInfo = processStartInfo, EnableRaisingEvents = true };
|
||||
|
||||
var commandLineLogMessage = _process.StartInfo.FileName + " " + _process.StartInfo.Arguments;
|
||||
var commandLineLogMessage = processStartInfo.FileName + " " + processStartInfo.Arguments;
|
||||
_logger.LogInformation(commandLineLogMessage);
|
||||
|
||||
var logFilePath = Path.Combine(_appPaths.LogDirectoryPath, "record-transcode-" + Guid.NewGuid() + ".txt");
|
||||
|
@ -104,6 +103,11 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
var commandLineLogMessageBytes = Encoding.UTF8.GetBytes(_json.SerializeToString(mediaSource) + Environment.NewLine + Environment.NewLine + commandLineLogMessage + Environment.NewLine + Environment.NewLine);
|
||||
_logFileStream.Write(commandLineLogMessageBytes, 0, commandLineLogMessageBytes.Length);
|
||||
|
||||
_process = new Process
|
||||
{
|
||||
StartInfo = processStartInfo,
|
||||
EnableRaisingEvents = true
|
||||
};
|
||||
_process.Exited += (sender, args) => OnFfMpegProcessExited(_process, inputFile);
|
||||
|
||||
_process.Start();
|
||||
|
|
|
@ -155,7 +155,12 @@ namespace MediaBrowser.MediaEncoding.Attachments
|
|||
inputPath,
|
||||
attachmentStreamIndex,
|
||||
outputPath);
|
||||
var startInfo = new ProcessStartInfo
|
||||
|
||||
int exitCode;
|
||||
|
||||
using (var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
Arguments = processArgs,
|
||||
FileName = _mediaEncoder.EncoderPath,
|
||||
|
@ -163,11 +168,9 @@ namespace MediaBrowser.MediaEncoding.Attachments
|
|||
CreateNoWindow = true,
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
ErrorDialog = false
|
||||
};
|
||||
|
||||
int exitCode;
|
||||
|
||||
using (var process = new Process { StartInfo = startInfo, EnableRaisingEvents = true })
|
||||
},
|
||||
EnableRaisingEvents = true
|
||||
})
|
||||
{
|
||||
_logger.LogInformation("{File} {Arguments}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
|
||||
|
|
|
@ -359,7 +359,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
: "{0} -i {1} -threads 0 -v warning -print_format json -show_streams -show_format";
|
||||
args = string.Format(args, probeSizeArgument, inputPath).Trim();
|
||||
|
||||
var processStartInfo = new ProcessStartInfo
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
CreateNoWindow = true,
|
||||
UseShellExecute = false,
|
||||
|
@ -373,16 +375,17 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
ErrorDialog = false,
|
||||
},
|
||||
EnableRaisingEvents = true
|
||||
};
|
||||
var process = new Process { StartInfo = processStartInfo, EnableRaisingEvents = true };
|
||||
|
||||
if (forceEnableLogging)
|
||||
{
|
||||
_logger.LogInformation("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
_logger.LogInformation("{ProcessFileName} {ProcessArgs}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogDebug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
_logger.LogDebug("{ProcessFileName} {ProcessArgs}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
}
|
||||
|
||||
using (var processWrapper = new ProcessWrapper(process, this))
|
||||
|
@ -568,7 +571,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
}
|
||||
}
|
||||
|
||||
var processStartInfo = new ProcessStartInfo
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
CreateNoWindow = true,
|
||||
UseShellExecute = false,
|
||||
|
@ -576,11 +581,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
Arguments = args,
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
ErrorDialog = false,
|
||||
},
|
||||
EnableRaisingEvents = true
|
||||
};
|
||||
|
||||
_logger.LogDebug("{0} {1}", processStartInfo.FileName, processStartInfo.Arguments);
|
||||
_logger.LogDebug("{ProcessFileName} {ProcessArguments}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
|
||||
var process = new Process { StartInfo = processStartInfo, EnableRaisingEvents = true };
|
||||
using (var processWrapper = new ProcessWrapper(process, this))
|
||||
{
|
||||
bool ranToCompletion;
|
||||
|
@ -713,7 +719,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
|
||||
bool ranToCompletion = false;
|
||||
|
||||
var process = new Process { StartInfo = processStartInfo, EnableRaisingEvents = true };
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = processStartInfo,
|
||||
EnableRaisingEvents = true
|
||||
};
|
||||
using (var processWrapper = new ProcessWrapper(process, this))
|
||||
{
|
||||
try
|
||||
|
|
|
@ -426,7 +426,11 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|||
encodingParam = " -sub_charenc " + encodingParam;
|
||||
}
|
||||
|
||||
var processStartInfo = new ProcessStartInfo
|
||||
int exitCode;
|
||||
|
||||
using (var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
CreateNoWindow = true,
|
||||
UseShellExecute = false,
|
||||
|
@ -434,11 +438,9 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|||
Arguments = string.Format("{0} -i \"{1}\" -c:s srt \"{2}\"", encodingParam, inputPath, outputPath),
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
ErrorDialog = false
|
||||
};
|
||||
|
||||
int exitCode;
|
||||
|
||||
using (var process = new Process { StartInfo = processStartInfo, EnableRaisingEvents = true })
|
||||
},
|
||||
EnableRaisingEvents = true
|
||||
})
|
||||
{
|
||||
_logger.LogInformation("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
|
||||
|
@ -577,7 +579,11 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|||
outputCodec,
|
||||
outputPath);
|
||||
|
||||
var processStartInfo = new ProcessStartInfo
|
||||
int exitCode;
|
||||
|
||||
using (var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
{
|
||||
CreateNoWindow = true,
|
||||
UseShellExecute = false,
|
||||
|
@ -585,11 +591,9 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|||
Arguments = processArgs,
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
ErrorDialog = false
|
||||
};
|
||||
|
||||
int exitCode;
|
||||
|
||||
using (var process = new Process { StartInfo = processStartInfo, EnableRaisingEvents = true })
|
||||
},
|
||||
EnableRaisingEvents = true
|
||||
})
|
||||
{
|
||||
_logger.LogInformation("{File} {Arguments}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user