Fix Aaru drive parameter generation (fixes #652)

This commit is contained in:
Matt Nadareski
2024-02-17 23:09:29 -05:00
parent cac6c3049b
commit 1a1fbd4b40
2 changed files with 22 additions and 6 deletions

View File

@@ -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)

View File

@@ -1067,10 +1067,8 @@ namespace MPF.Core.Modules.Aaru
// 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:
@@ -1080,12 +1078,21 @@ namespace MPF.Core.Modules.Aaru
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
@@ -1097,10 +1104,9 @@ namespace MPF.Core.Modules.Aaru
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;
@@ -1108,6 +1114,15 @@ namespace MPF.Core.Modules.Aaru
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: