Make media scanning non-static.

This commit is contained in:
2019-04-21 00:11:27 +01:00
parent 993c839751
commit 9052ea80f4
9 changed files with 55 additions and 58 deletions

View File

@@ -30,7 +30,6 @@
// Copyright © 2011-2019 Natalia Portillo
// ****************************************************************************/
using System;
using System.Collections.Generic;
using DiscImageChef.CommonTypes.Enums;
using DiscImageChef.Console;
@@ -112,26 +111,8 @@ namespace DiscImageChef.Commands
Statistics.AddDevice(dev);
ScanResults results;
switch(dev.Type)
{
case DeviceType.ATA:
results = Ata.Scan(mhddLogPath, ibgLogPath, devicePath, dev);
break;
case DeviceType.MMC:
case DeviceType.SecureDigital:
results = SecureDigital.Scan(mhddLogPath, ibgLogPath, devicePath, dev);
break;
case DeviceType.NVMe:
results = Nvme.Scan(mhddLogPath, ibgLogPath, devicePath, dev);
break;
case DeviceType.ATAPI:
case DeviceType.SCSI:
results = Scsi.Scan(mhddLogPath, ibgLogPath, devicePath, dev);
break;
default: throw new NotSupportedException("Unknown device type.");
}
MediaScan scanner = new MediaScan(mhddLogPath, ibgLogPath, devicePath, dev);
ScanResults results = scanner.Scan();
DicConsole.WriteLine("Took a total of {0} seconds ({1} processing commands).", results.TotalTime,
results.ProcessingTime);