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

@@ -48,9 +48,11 @@ namespace Aaru.CommonTypes
/// <param name="blocks">How many blocks are on the media</param>
/// <param name="blockSize">Size in bytes of each block</param>
/// <param name="isUsb">Device is USB</param>
/// <param name="opticalDisc"></param>
/// <returns></returns>
public static MediaType GetFromScsi(byte scsiPeripheralType, string vendor, string model, byte mediumType,
byte densityCode, ulong blocks, uint blockSize, bool isUsb)
byte densityCode, ulong blocks, uint blockSize, bool isUsb,
bool opticalDisc)
{
switch(scsiPeripheralType)
{
@@ -75,7 +77,7 @@ namespace Aaru.CommonTypes
case 0x07: return GetFromOdc(mediumType, blocks, blockSize);
// MultiMedia Device
case 0x05: return GetFromMmc(model, mediumType, densityCode, blocks, blockSize, isUsb);
case 0x05: return GetFromMmc(model, mediumType, densityCode, blocks, blockSize, isUsb, opticalDisc);
// MD DATA drives
case 0x10 when model.StartsWith("MDM", StringComparison.Ordinal) ||