Fix misdetecting optical discs as flash drives.

This commit is contained in:
2020-12-29 19:37:16 +00:00
parent 16780e9ba3
commit 069a2e39cc
3 changed files with 9 additions and 7 deletions

View File

@@ -40,7 +40,7 @@ namespace Aaru.CommonTypes
public static partial class MediaTypeFromDevice
{
static MediaType GetFromMmc(string model, byte mediumType, byte densityCode, ulong blocks, uint blockSize,
bool isUsb)
bool isUsb, bool opticalDisc)
{
switch(mediumType)
{
@@ -122,9 +122,9 @@ namespace Aaru.CommonTypes
"SCSI medium type is {0:X2}h, setting media type to CD-RW.", mediumType);
return MediaType.CDRW;
case 0x40 when isUsb:
case 0x41 when isUsb:
case 0x42 when isUsb:
case 0x40 when isUsb && !opticalDisc:
case 0x41 when isUsb && !opticalDisc:
case 0x42 when isUsb && !opticalDisc:
AaruConsole.DebugWriteLine("Media detection",
"SCSI medium type is {0:X2}h and device is USB, setting media type to Flash Drive.",
mediumType);