From 951aa79cce726d561ec6a16f06c3ac27e2a2227b Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 4 Jan 2020 02:28:17 +0000 Subject: [PATCH] Change --no-metadata to --metadata and --no-trim to --trim. --- .../.idea/contentModel.xml | 3 --- DiscImageChef.Core/Devices/Dumping/ATA.cs | 4 ++-- .../Devices/Dumping/CompactDisc/Dump.cs | 2 +- .../Devices/Dumping/CompactDisc/Trim.cs | 2 +- DiscImageChef.Core/Devices/Dumping/Dump.cs | 14 +++++++------- .../Devices/Dumping/PlayStationPortable.cs | 8 ++++---- DiscImageChef.Core/Devices/Dumping/SBC.cs | 4 ++-- DiscImageChef.Core/Devices/Dumping/SSC.cs | 2 +- .../Devices/Dumping/SecureDigital.cs | 4 ++-- DiscImageChef.Core/Devices/Dumping/XGD.cs | 4 ++-- DiscImageChef/Commands/Media/Dump.cs | 19 ++++++++++--------- 11 files changed, 32 insertions(+), 34 deletions(-) diff --git a/.idea/.idea.DiscImageChef/.idea/contentModel.xml b/.idea/.idea.DiscImageChef/.idea/contentModel.xml index 89ef512ca..1e8f11abf 100644 --- a/.idea/.idea.DiscImageChef/.idea/contentModel.xml +++ b/.idea/.idea.DiscImageChef/.idea/contentModel.xml @@ -3,10 +3,8 @@ - - @@ -508,7 +506,6 @@ - diff --git a/DiscImageChef.Core/Devices/Dumping/ATA.cs b/DiscImageChef.Core/Devices/Dumping/ATA.cs index b05b9a17b..673c8f758 100644 --- a/DiscImageChef.Core/Devices/Dumping/ATA.cs +++ b/DiscImageChef.Core/Devices/Dumping/ATA.cs @@ -352,7 +352,7 @@ namespace DiscImageChef.Core.Devices.Dumping #region Trimming if(_resume.BadBlocks.Count > 0 && !_aborted && - !_notrim && + _trim && newTrim) { start = DateTime.UtcNow; @@ -595,7 +595,7 @@ namespace DiscImageChef.Core.Devices.Dumping double totalChkDuration = 0; - if(!_nometadata) + if(_metadata) { _dumpLog.WriteLine("Creating sidecar."); UpdateStatus?.Invoke("Creating sidecar."); diff --git a/DiscImageChef.Core/Devices/Dumping/CompactDisc/Dump.cs b/DiscImageChef.Core/Devices/Dumping/CompactDisc/Dump.cs index b59582343..944ec9565 100644 --- a/DiscImageChef.Core/Devices/Dumping/CompactDisc/Dump.cs +++ b/DiscImageChef.Core/Devices/Dumping/CompactDisc/Dump.cs @@ -962,7 +962,7 @@ namespace DiscImageChef.Core.Devices.Dumping double totalChkDuration = 0; - if(!_nometadata) + if(_metadata) WriteOpticalSidecar(blockSize, blocks, dskType, null, mediaTags, sessions, out totalChkDuration); end = DateTime.UtcNow; diff --git a/DiscImageChef.Core/Devices/Dumping/CompactDisc/Trim.cs b/DiscImageChef.Core/Devices/Dumping/CompactDisc/Trim.cs index 8bfea9e8b..10fae0eaa 100644 --- a/DiscImageChef.Core/Devices/Dumping/CompactDisc/Trim.cs +++ b/DiscImageChef.Core/Devices/Dumping/CompactDisc/Trim.cs @@ -59,7 +59,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(_resume.BadBlocks.Count <= 0 || _aborted || - _notrim || + !_trim || !newTrim) return; diff --git a/DiscImageChef.Core/Devices/Dumping/Dump.cs b/DiscImageChef.Core/Devices/Dumping/Dump.cs index 8fd5d7588..ca9711a1f 100644 --- a/DiscImageChef.Core/Devices/Dumping/Dump.cs +++ b/DiscImageChef.Core/Devices/Dumping/Dump.cs @@ -31,8 +31,7 @@ namespace DiscImageChef.Core.Devices.Dumping readonly Encoding _encoding; readonly bool _force; readonly Dictionary _formatOptions; - readonly bool _nometadata; - readonly bool _notrim; + readonly bool _metadata; readonly string _outputPath; readonly IWritableImage _outputPlugin; readonly string _outputPrefix; @@ -41,6 +40,7 @@ namespace DiscImageChef.Core.Devices.Dumping readonly ushort _retryPasses; readonly bool _stopOnError; readonly DumpSubchannel _subchannel; + readonly bool _trim; bool _aborted; DicContext _ctx; // Master database context Database.Models.Device _dbDev; // Device database entry @@ -69,15 +69,15 @@ namespace DiscImageChef.Core.Devices.Dumping /// Encoding to use when analyzing dump /// Path to output file /// Formats to pass to output file plugin - /// Do not trim errors from skipped sectors + /// Trim errors from skipped sectors /// Try to read and dump as much first track pregap as possible /// Sidecar to store in dumped image /// How many sectors to skip reading on error - /// Create metadata sidecar after dump? + /// Create metadata sidecar after dump? public Dump(bool doResume, Device dev, string devicePath, IWritableImage outputPlugin, ushort retryPasses, bool force, bool dumpRaw, bool persistent, bool stopOnError, Resume resume, DumpLog dumpLog, Encoding encoding, string outputPrefix, string outputPath, Dictionary formatOptions, - CICMMetadataType preSidecar, uint skip, bool nometadata, bool notrim, bool dumpFirstTrackPregap, + CICMMetadataType preSidecar, uint skip, bool metadata, bool trim, bool dumpFirstTrackPregap, bool fixOffset, bool debug, DumpSubchannel subchannel, int speed) { _doResume = doResume; @@ -97,8 +97,8 @@ namespace DiscImageChef.Core.Devices.Dumping _formatOptions = formatOptions; _preSidecar = preSidecar; _skip = skip; - _nometadata = nometadata; - _notrim = notrim; + _metadata = metadata; + _trim = trim; _dumpFirstTrackPregap = dumpFirstTrackPregap; _aborted = false; _fixOffset = fixOffset; diff --git a/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs b/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs index 26d290d33..02b27c01a 100644 --- a/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs +++ b/DiscImageChef.Core/Devices/Dumping/PlayStationPortable.cs @@ -419,7 +419,7 @@ namespace DiscImageChef.Core.Devices.Dumping #region Trimming if(_resume.BadBlocks.Count > 0 && !_aborted && - !_notrim && + _trim && newTrim) { start = DateTime.UtcNow; @@ -651,7 +651,7 @@ namespace DiscImageChef.Core.Devices.Dumping double totalChkDuration = 0; - if(!_nometadata) + if(_metadata) { WriteOpticalSidecar(BLOCK_SIZE, blocks, DSK_TYPE, null, null, 1, out totalChkDuration); } @@ -879,7 +879,7 @@ namespace DiscImageChef.Core.Devices.Dumping #region Trimming if(_resume.BadBlocks.Count > 0 && !_aborted && - !_notrim && + _trim && newTrim) { start = DateTime.UtcNow; @@ -1117,7 +1117,7 @@ namespace DiscImageChef.Core.Devices.Dumping double totalChkDuration = 0; - if(!_nometadata) + if(_metadata) { UpdateStatus?.Invoke("Creating sidecar."); _dumpLog.WriteLine("Creating sidecar."); diff --git a/DiscImageChef.Core/Devices/Dumping/SBC.cs b/DiscImageChef.Core/Devices/Dumping/SBC.cs index 6924b1e90..ba13e49b2 100644 --- a/DiscImageChef.Core/Devices/Dumping/SBC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SBC.cs @@ -530,7 +530,7 @@ namespace DiscImageChef.Core.Devices.Dumping #region Trimming if(_resume.BadBlocks.Count > 0 && !_aborted && - !_notrim && + _trim && newTrim) { start = DateTime.UtcNow; @@ -986,7 +986,7 @@ namespace DiscImageChef.Core.Devices.Dumping double totalChkDuration = 0; - if(!_nometadata) + if(_metadata) { // TODO: Layers if(opticalDisc) diff --git a/DiscImageChef.Core/Devices/Dumping/SSC.cs b/DiscImageChef.Core/Devices/Dumping/SSC.cs index e86108a8d..ec553f4bd 100644 --- a/DiscImageChef.Core/Devices/Dumping/SSC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SSC.cs @@ -1250,7 +1250,7 @@ namespace DiscImageChef.Core.Devices.Dumping double totalChkDuration = 0; - if(!_nometadata) + if(_metadata) { UpdateStatus?.Invoke("Creating sidecar."); _dumpLog.WriteLine("Creating sidecar."); diff --git a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs index 38f2a51a8..b1df3b563 100644 --- a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs +++ b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs @@ -415,7 +415,7 @@ namespace DiscImageChef.Core.Devices.Dumping #region Trimming if(_resume.BadBlocks.Count > 0 && !_aborted && - !_notrim && + _trim && newTrim) { start = DateTime.UtcNow; @@ -544,7 +544,7 @@ namespace DiscImageChef.Core.Devices.Dumping double totalChkDuration = 0; - if(!_nometadata) + if(_metadata) { UpdateStatus?.Invoke("Creating sidecar."); _dumpLog.WriteLine("Creating sidecar."); diff --git a/DiscImageChef.Core/Devices/Dumping/XGD.cs b/DiscImageChef.Core/Devices/Dumping/XGD.cs index 4f0df4f52..318445917 100644 --- a/DiscImageChef.Core/Devices/Dumping/XGD.cs +++ b/DiscImageChef.Core/Devices/Dumping/XGD.cs @@ -884,7 +884,7 @@ namespace DiscImageChef.Core.Devices.Dumping #region Trimming if(_resume.BadBlocks.Count > 0 && !_aborted && - !_notrim && + _trim && newTrim) { start = DateTime.UtcNow; @@ -1167,7 +1167,7 @@ namespace DiscImageChef.Core.Devices.Dumping double totalChkDuration = 0; - if(!_nometadata) + if(_metadata) { var layers = new LayersType { diff --git a/DiscImageChef/Commands/Media/Dump.cs b/DiscImageChef/Commands/Media/Dump.cs index b96383d56..1c2e3dfef 100644 --- a/DiscImageChef/Commands/Media/Dump.cs +++ b/DiscImageChef/Commands/Media/Dump.cs @@ -99,14 +99,14 @@ namespace DiscImageChef.Commands.Media Argument = new Argument(() => null), Required = false }); - Add(new Option("--no-metadata", "Disables creating CICM XML sidecar.") + Add(new Option("--metadata", "Enables creating CICM XML sidecar.") { - Argument = new Argument(() => false), Required = false + Argument = new Argument(() => true), Required = false }); - Add(new Option("--no-trim", "Disables trimming errored from skipped sectors.") + Add(new Option("--trim", "Enables trimming errored from skipped sectors.") { - Argument = new Argument(() => false), Required = false + Argument = new Argument(() => true), Required = false }); Add(new Option(new[] @@ -179,8 +179,8 @@ namespace DiscImageChef.Commands.Media } public static int Invoke(bool debug, bool verbose, string cicmXml, string devicePath, bool resume, - string encoding, bool firstPregap, bool fixOffset, bool force, bool noMetadata, - bool noTrim, string outputPath, string options, bool persistent, ushort retryPasses, + string encoding, bool firstPregap, bool fixOffset, bool force, bool metadata, + bool trim, string outputPath, string options, bool persistent, ushort retryPasses, uint skip, byte speed, bool stopOnError, string format, string subchannel) { MainClass.PrintCopyright(); @@ -198,10 +198,10 @@ namespace DiscImageChef.Commands.Media DicConsole.DebugWriteLine("Dump-Media command", "--device={0}", devicePath); DicConsole.DebugWriteLine("Dump-Media command", "--encoding={0}", encoding); DicConsole.DebugWriteLine("Dump-Media command", "--first-pregap={0}", firstPregap); - DicConsole.DebugWriteLine("Dump-Media command", "--force={0}", force); + DicConsole.DebugWriteLine("Dump-Media command", "--fix-offset={0}", fixOffset); DicConsole.DebugWriteLine("Dump-Media command", "--force={0}", force); DicConsole.DebugWriteLine("Dump-Media command", "--format={0}", format); - DicConsole.DebugWriteLine("Dump-Media command", "--no-metadata={0}", noMetadata); + DicConsole.DebugWriteLine("Dump-Media command", "--metadata={0}", metadata); DicConsole.DebugWriteLine("Dump-Media command", "--options={0}", options); DicConsole.DebugWriteLine("Dump-Media command", "--output={0}", outputPath); DicConsole.DebugWriteLine("Dump-Media command", "--persistent={0}", persistent); @@ -209,6 +209,7 @@ namespace DiscImageChef.Commands.Media DicConsole.DebugWriteLine("Dump-Media command", "--retry-passes={0}", retryPasses); DicConsole.DebugWriteLine("Dump-Media command", "--skip={0}", skip); DicConsole.DebugWriteLine("Dump-Media command", "--stop-on-error={0}", stopOnError); + DicConsole.DebugWriteLine("Dump-Media command", "--trim={0}", trim); DicConsole.DebugWriteLine("Dump-Media command", "--verbose={0}", verbose); DicConsole.DebugWriteLine("Dump-Media command", "--subchannel={0}", subchannel); @@ -407,7 +408,7 @@ namespace DiscImageChef.Commands.Media var dumper = new Dump(resume, dev, devicePath, outputFormat, retryPasses, force, false, persistent, stopOnError, resumeClass, dumpLog, encodingClass, outputPrefix, outputPath, - parsedOptions, sidecar, skip, noMetadata, noTrim, firstPregap, fixOffset, debug, + parsedOptions, sidecar, skip, metadata, trim, firstPregap, fixOffset, debug, wantedSubchannel, speed); dumper.UpdateStatus += Progress.UpdateStatus;