Non-dumping commands shouldn't cause issues

This commit is contained in:
Matt Nadareski
2020-02-04 13:25:50 -08:00
parent b09a87c7e4
commit ff5bc464ab
4 changed files with 64 additions and 3 deletions

View File

@@ -783,6 +783,22 @@ namespace DICUI.Utilities
return string.Join(" ", parameters);
}
/// <summary>
/// Gets if the current command is considered a dumping command or not
/// </summary>
/// <returns>True if it's a dumping command, false otherwise</returns>
public bool IsDumpingCommand()
{
switch (Command)
{
case ChefCommand.MediaDump:
return true;
default:
return false;
}
}
/// <summary>
/// Returns if the current Parameter object is valid
/// </summary>

View File

@@ -616,6 +616,35 @@ namespace DICUI.Utilities
return string.Join(" ", parameters);
}
/// <summary>
/// Gets if the current command is considered a dumping command or not
/// </summary>
/// <returns>True if it's a dumping command, false otherwise</returns>
public bool IsDumpingCommand()
{
switch (Command)
{
case CreatorCommand.Audio:
case CreatorCommand.BluRay:
case CreatorCommand.CompactDisc:
case CreatorCommand.Data:
case CreatorCommand.DigitalVideoDisc:
case CreatorCommand.Disk:
case CreatorCommand.Floppy:
case CreatorCommand.GDROM:
case CreatorCommand.SACD:
case CreatorCommand.Swap:
case CreatorCommand.XBOX:
case CreatorCommand.XBOXSwap:
case CreatorCommand.XGD2Swap:
case CreatorCommand.XGD3Swap:
return true;
default:
return false;
}
}
/// <summary>
/// Returns if the current Parameter object is valid
/// </summary>

View File

@@ -419,9 +419,9 @@ namespace DICUI.Utilities
}
/// <summary>
/// Execute a complete dump workflow
/// Execute the initial invocation of the dumping programs
/// </summary>
public async Task<Result> StartDumping(IProgress<Result> progress)
public async Task<Result> Run(IProgress<Result> progress)
{
Result result = IsValidForDump();

View File

@@ -550,7 +550,23 @@ namespace DICUI.Windows
var progress = new Progress<Result>();
progress.ProgressChanged += ProgressUpdated;
Result result = await _env.StartDumping(progress);
Result result = await _env.Run(progress);
// If we didn't execute a dumping command we cannot get submission output
bool isDumpingCommand = false;
if (_env.UseChef)
isDumpingCommand = _env.ChefParameters.IsDumpingCommand();
else
isDumpingCommand = _env.CreatorParameters.IsDumpingCommand();
if (!isDumpingCommand)
{
ViewModels.LoggerViewModel.VerboseLogLn("No dumping command was run, submission information will not be gathered.");
StatusLabel.Content = "Execution complete!";
StartStopButton.Content = Constants.StartDumping;
CopyProtectScanButton.IsEnabled = true;
return;
}
if (result)
{