Skip to content

Commit

Permalink
Fix Aaru drive parameter generation (fixes SabreTools#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnadareski committed Feb 18, 2024
1 parent cac6c30 commit 1a1fbd4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fix DIC log parsing for SS version
- Write outputs with UTF-8
- Add funworld Photo Play detection
- Fix Aaru drive parameter generation

### 3.1.0 (2024-02-06)

Expand Down
27 changes: 21 additions & 6 deletions MPF.Core/Modules/Aaru/Parameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1067,10 +1067,8 @@ public override void GenerateSubmissionInfo(SubmissionInfo info, Options options
// Handle filenames based on command, if necessary
switch (BaseCommand)
{
// Input value only
// Input value only (file path)
case CommandStrings.ArchivePrefixLong + " " + CommandStrings.ArchiveInfo:
case CommandStrings.DevicePrefixLong + " " + CommandStrings.DeviceInfo:
case CommandStrings.DevicePrefixLong + " " + CommandStrings.DeviceReport:
case CommandStrings.FilesystemPrefixLong + " " + CommandStrings.FilesystemInfo:
case CommandStrings.FilesystemPrefixLong + " " + CommandStrings.FilesystemListLong:
case CommandStrings.ImagePrefixLong + " " + CommandStrings.ImageChecksumLong:
Expand All @@ -1080,12 +1078,21 @@ public override void GenerateSubmissionInfo(SubmissionInfo info, Options options
case CommandStrings.ImagePrefixLong + " " + CommandStrings.ImageInfo:
case CommandStrings.ImagePrefixLong + " " + CommandStrings.ImagePrint:
case CommandStrings.ImagePrefixLong + " " + CommandStrings.ImageVerify:
if (string.IsNullOrEmpty(InputValue))
return null;

parameters.Add($"\"{InputValue}\"");
break;

// Input value only (device path)
case CommandStrings.DevicePrefixLong + " " + CommandStrings.DeviceInfo:
case CommandStrings.DevicePrefixLong + " " + CommandStrings.DeviceReport:
case CommandStrings.MediaPrefixLong + " " + CommandStrings.MediaInfo:
case CommandStrings.MediaPrefixLong + " " + CommandStrings.MediaScan:
if (string.IsNullOrEmpty(InputValue))
return null;

parameters.Add($"\"{InputValue}\"");
parameters.Add(InputValue!.TrimEnd('\\'));
break;

// Two input values
Expand All @@ -1097,17 +1104,25 @@ public override void GenerateSubmissionInfo(SubmissionInfo info, Options options
parameters.Add($"\"{Input2Value}\"");
break;

// Input and Output value
// Input and Output value (file path)
case CommandStrings.FilesystemPrefixLong + " " + CommandStrings.FilesystemExtract:
case CommandStrings.ImagePrefixLong + " " + CommandStrings.ImageConvert:
case CommandStrings.MediaPrefixLong + " " + CommandStrings.MediaDump:
if (string.IsNullOrEmpty(InputValue) || string.IsNullOrEmpty(OutputValue))
return null;

parameters.Add($"\"{InputValue}\"");
parameters.Add($"\"{OutputValue}\"");
break;

// Input and Output value (device path)
case CommandStrings.MediaPrefixLong + " " + CommandStrings.MediaDump:
if (string.IsNullOrEmpty(InputValue) || string.IsNullOrEmpty(OutputValue))
return null;

parameters.Add(InputValue!.TrimEnd('\\'));
parameters.Add($"\"{OutputValue}\"");
break;

// Remote host value only
case CommandStrings.DevicePrefixLong + " " + CommandStrings.DeviceList:
case CommandStrings.Remote:
Expand Down

0 comments on commit 1a1fbd4

Please sign in to comment.