mirror of
https://github.com/aaru-dps/Aaru.CommonTypes.git
synced 2025-12-16 19:24:30 +00:00
Fix misdetecting optical discs as flash drives.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user