Change --no-metadata to --metadata and --no-trim to --trim.

This commit is contained in:
2020-01-04 02:28:17 +00:00
parent 9eec967646
commit 951aa79cce
11 changed files with 32 additions and 34 deletions

View File

@@ -3,10 +3,8 @@
<component name="ContentModelStore"> <component name="ContentModelStore">
<e p="$APPLICATION_CONFIG_DIR$/consoles/db" t="IncludeRecursive" /> <e p="$APPLICATION_CONFIG_DIR$/consoles/db" t="IncludeRecursive" />
<e p="$APPLICATION_PLUGINS_DIR$/puppet/lib/stubs" t="IncludeRecursive" /> <e p="$APPLICATION_PLUGINS_DIR$/puppet/lib/stubs" t="IncludeRecursive" />
<e p="$APPLICATION_CONFIG_DIR$/scratches" t="IncludeRecursive" />
<e p="$USER_HOME$/.Rider2019.3/system/extResources" t="IncludeRecursive" /> <e p="$USER_HOME$/.Rider2019.3/system/extResources" t="IncludeRecursive" />
<e p="$USER_HOME$/.Rider2019.3/system/resharper-host/local/Transient/ReSharperHost/v193/SolutionCaches/_DiscImageChef.-1491758497.00" t="ExcludeRecursive" /> <e p="$USER_HOME$/.Rider2019.3/system/resharper-host/local/Transient/ReSharperHost/v193/SolutionCaches/_DiscImageChef.-1491758497.00" t="ExcludeRecursive" />
<e p="$USER_HOME$/.config/git/ignore" t="IncludeRecursive" />
<e p="$USER_HOME$/.nuget/packages/sqlitepclraw.lib.e_sqlite3.linux/1.1.12/runtimes/linux-x64/native/libe_sqlite3.so" t="Include" /> <e p="$USER_HOME$/.nuget/packages/sqlitepclraw.lib.e_sqlite3.linux/1.1.12/runtimes/linux-x64/native/libe_sqlite3.so" t="Include" />
<e p="$PROJECT_DIR$" t="IncludeFlat"> <e p="$PROJECT_DIR$" t="IncludeFlat">
<e p=".git/info/exclude" t="IncludeRecursive" /> <e p=".git/info/exclude" t="IncludeRecursive" />
@@ -508,7 +506,6 @@
<e p="CIS.cs" t="Include" /> <e p="CIS.cs" t="Include" />
<e p="Enums.cs" t="Include" /> <e p="Enums.cs" t="Include" />
<e p="Types.cs" t="Include" /> <e p="Types.cs" t="Include" />
<e p="Types.cs~" t="Include" />
<e p="VendorCode.cs" t="Include" /> <e p="VendorCode.cs" t="Include" />
</e> </e>
<e p="SCSI" t="Include"> <e p="SCSI" t="Include">

View File

@@ -352,7 +352,7 @@ namespace DiscImageChef.Core.Devices.Dumping
#region Trimming #region Trimming
if(_resume.BadBlocks.Count > 0 && if(_resume.BadBlocks.Count > 0 &&
!_aborted && !_aborted &&
!_notrim && _trim &&
newTrim) newTrim)
{ {
start = DateTime.UtcNow; start = DateTime.UtcNow;
@@ -595,7 +595,7 @@ namespace DiscImageChef.Core.Devices.Dumping
double totalChkDuration = 0; double totalChkDuration = 0;
if(!_nometadata) if(_metadata)
{ {
_dumpLog.WriteLine("Creating sidecar."); _dumpLog.WriteLine("Creating sidecar.");
UpdateStatus?.Invoke("Creating sidecar."); UpdateStatus?.Invoke("Creating sidecar.");

View File

@@ -962,7 +962,7 @@ namespace DiscImageChef.Core.Devices.Dumping
double totalChkDuration = 0; double totalChkDuration = 0;
if(!_nometadata) if(_metadata)
WriteOpticalSidecar(blockSize, blocks, dskType, null, mediaTags, sessions, out totalChkDuration); WriteOpticalSidecar(blockSize, blocks, dskType, null, mediaTags, sessions, out totalChkDuration);
end = DateTime.UtcNow; end = DateTime.UtcNow;

View File

@@ -59,7 +59,7 @@ namespace DiscImageChef.Core.Devices.Dumping
if(_resume.BadBlocks.Count <= 0 || if(_resume.BadBlocks.Count <= 0 ||
_aborted || _aborted ||
_notrim || !_trim ||
!newTrim) !newTrim)
return; return;

View File

@@ -31,8 +31,7 @@ namespace DiscImageChef.Core.Devices.Dumping
readonly Encoding _encoding; readonly Encoding _encoding;
readonly bool _force; readonly bool _force;
readonly Dictionary<string, string> _formatOptions; readonly Dictionary<string, string> _formatOptions;
readonly bool _nometadata; readonly bool _metadata;
readonly bool _notrim;
readonly string _outputPath; readonly string _outputPath;
readonly IWritableImage _outputPlugin; readonly IWritableImage _outputPlugin;
readonly string _outputPrefix; readonly string _outputPrefix;
@@ -41,6 +40,7 @@ namespace DiscImageChef.Core.Devices.Dumping
readonly ushort _retryPasses; readonly ushort _retryPasses;
readonly bool _stopOnError; readonly bool _stopOnError;
readonly DumpSubchannel _subchannel; readonly DumpSubchannel _subchannel;
readonly bool _trim;
bool _aborted; bool _aborted;
DicContext _ctx; // Master database context DicContext _ctx; // Master database context
Database.Models.Device _dbDev; // Device database entry Database.Models.Device _dbDev; // Device database entry
@@ -69,15 +69,15 @@ namespace DiscImageChef.Core.Devices.Dumping
/// <param name="encoding">Encoding to use when analyzing dump</param> /// <param name="encoding">Encoding to use when analyzing dump</param>
/// <param name="outputPath">Path to output file</param> /// <param name="outputPath">Path to output file</param>
/// <param name="formatOptions">Formats to pass to output file plugin</param> /// <param name="formatOptions">Formats to pass to output file plugin</param>
/// <param name="notrim">Do not trim errors from skipped sectors</param> /// <param name="trim">Trim errors from skipped sectors</param>
/// <param name="dumpFirstTrackPregap">Try to read and dump as much first track pregap as possible</param> /// <param name="dumpFirstTrackPregap">Try to read and dump as much first track pregap as possible</param>
/// <param name="preSidecar">Sidecar to store in dumped image</param> /// <param name="preSidecar">Sidecar to store in dumped image</param>
/// <param name="skip">How many sectors to skip reading on error</param> /// <param name="skip">How many sectors to skip reading on error</param>
/// <param name="nometadata">Create metadata sidecar after dump?</param> /// <param name="metadata">Create metadata sidecar after dump?</param>
public Dump(bool doResume, Device dev, string devicePath, IWritableImage outputPlugin, ushort retryPasses, public Dump(bool doResume, Device dev, string devicePath, IWritableImage outputPlugin, ushort retryPasses,
bool force, bool dumpRaw, bool persistent, bool stopOnError, Resume resume, DumpLog dumpLog, bool force, bool dumpRaw, bool persistent, bool stopOnError, Resume resume, DumpLog dumpLog,
Encoding encoding, string outputPrefix, string outputPath, Dictionary<string, string> formatOptions, Encoding encoding, string outputPrefix, string outputPath, Dictionary<string, string> 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) bool fixOffset, bool debug, DumpSubchannel subchannel, int speed)
{ {
_doResume = doResume; _doResume = doResume;
@@ -97,8 +97,8 @@ namespace DiscImageChef.Core.Devices.Dumping
_formatOptions = formatOptions; _formatOptions = formatOptions;
_preSidecar = preSidecar; _preSidecar = preSidecar;
_skip = skip; _skip = skip;
_nometadata = nometadata; _metadata = metadata;
_notrim = notrim; _trim = trim;
_dumpFirstTrackPregap = dumpFirstTrackPregap; _dumpFirstTrackPregap = dumpFirstTrackPregap;
_aborted = false; _aborted = false;
_fixOffset = fixOffset; _fixOffset = fixOffset;

View File

@@ -419,7 +419,7 @@ namespace DiscImageChef.Core.Devices.Dumping
#region Trimming #region Trimming
if(_resume.BadBlocks.Count > 0 && if(_resume.BadBlocks.Count > 0 &&
!_aborted && !_aborted &&
!_notrim && _trim &&
newTrim) newTrim)
{ {
start = DateTime.UtcNow; start = DateTime.UtcNow;
@@ -651,7 +651,7 @@ namespace DiscImageChef.Core.Devices.Dumping
double totalChkDuration = 0; double totalChkDuration = 0;
if(!_nometadata) if(_metadata)
{ {
WriteOpticalSidecar(BLOCK_SIZE, blocks, DSK_TYPE, null, null, 1, out totalChkDuration); WriteOpticalSidecar(BLOCK_SIZE, blocks, DSK_TYPE, null, null, 1, out totalChkDuration);
} }
@@ -879,7 +879,7 @@ namespace DiscImageChef.Core.Devices.Dumping
#region Trimming #region Trimming
if(_resume.BadBlocks.Count > 0 && if(_resume.BadBlocks.Count > 0 &&
!_aborted && !_aborted &&
!_notrim && _trim &&
newTrim) newTrim)
{ {
start = DateTime.UtcNow; start = DateTime.UtcNow;
@@ -1117,7 +1117,7 @@ namespace DiscImageChef.Core.Devices.Dumping
double totalChkDuration = 0; double totalChkDuration = 0;
if(!_nometadata) if(_metadata)
{ {
UpdateStatus?.Invoke("Creating sidecar."); UpdateStatus?.Invoke("Creating sidecar.");
_dumpLog.WriteLine("Creating sidecar."); _dumpLog.WriteLine("Creating sidecar.");

View File

@@ -530,7 +530,7 @@ namespace DiscImageChef.Core.Devices.Dumping
#region Trimming #region Trimming
if(_resume.BadBlocks.Count > 0 && if(_resume.BadBlocks.Count > 0 &&
!_aborted && !_aborted &&
!_notrim && _trim &&
newTrim) newTrim)
{ {
start = DateTime.UtcNow; start = DateTime.UtcNow;
@@ -986,7 +986,7 @@ namespace DiscImageChef.Core.Devices.Dumping
double totalChkDuration = 0; double totalChkDuration = 0;
if(!_nometadata) if(_metadata)
{ {
// TODO: Layers // TODO: Layers
if(opticalDisc) if(opticalDisc)

View File

@@ -1250,7 +1250,7 @@ namespace DiscImageChef.Core.Devices.Dumping
double totalChkDuration = 0; double totalChkDuration = 0;
if(!_nometadata) if(_metadata)
{ {
UpdateStatus?.Invoke("Creating sidecar."); UpdateStatus?.Invoke("Creating sidecar.");
_dumpLog.WriteLine("Creating sidecar."); _dumpLog.WriteLine("Creating sidecar.");

View File

@@ -415,7 +415,7 @@ namespace DiscImageChef.Core.Devices.Dumping
#region Trimming #region Trimming
if(_resume.BadBlocks.Count > 0 && if(_resume.BadBlocks.Count > 0 &&
!_aborted && !_aborted &&
!_notrim && _trim &&
newTrim) newTrim)
{ {
start = DateTime.UtcNow; start = DateTime.UtcNow;
@@ -544,7 +544,7 @@ namespace DiscImageChef.Core.Devices.Dumping
double totalChkDuration = 0; double totalChkDuration = 0;
if(!_nometadata) if(_metadata)
{ {
UpdateStatus?.Invoke("Creating sidecar."); UpdateStatus?.Invoke("Creating sidecar.");
_dumpLog.WriteLine("Creating sidecar."); _dumpLog.WriteLine("Creating sidecar.");

View File

@@ -884,7 +884,7 @@ namespace DiscImageChef.Core.Devices.Dumping
#region Trimming #region Trimming
if(_resume.BadBlocks.Count > 0 && if(_resume.BadBlocks.Count > 0 &&
!_aborted && !_aborted &&
!_notrim && _trim &&
newTrim) newTrim)
{ {
start = DateTime.UtcNow; start = DateTime.UtcNow;
@@ -1167,7 +1167,7 @@ namespace DiscImageChef.Core.Devices.Dumping
double totalChkDuration = 0; double totalChkDuration = 0;
if(!_nometadata) if(_metadata)
{ {
var layers = new LayersType var layers = new LayersType
{ {

View File

@@ -99,14 +99,14 @@ namespace DiscImageChef.Commands.Media
Argument = new Argument<string>(() => null), Required = false Argument = new Argument<string>(() => 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<bool>(() => false), Required = false Argument = new Argument<bool>(() => 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<bool>(() => false), Required = false Argument = new Argument<bool>(() => true), Required = false
}); });
Add(new Option(new[] 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, public static int Invoke(bool debug, bool verbose, string cicmXml, string devicePath, bool resume,
string encoding, bool firstPregap, bool fixOffset, bool force, bool noMetadata, string encoding, bool firstPregap, bool fixOffset, bool force, bool metadata,
bool noTrim, string outputPath, string options, bool persistent, ushort retryPasses, bool trim, string outputPath, string options, bool persistent, ushort retryPasses,
uint skip, byte speed, bool stopOnError, string format, string subchannel) uint skip, byte speed, bool stopOnError, string format, string subchannel)
{ {
MainClass.PrintCopyright(); MainClass.PrintCopyright();
@@ -198,10 +198,10 @@ namespace DiscImageChef.Commands.Media
DicConsole.DebugWriteLine("Dump-Media command", "--device={0}", devicePath); DicConsole.DebugWriteLine("Dump-Media command", "--device={0}", devicePath);
DicConsole.DebugWriteLine("Dump-Media command", "--encoding={0}", encoding); DicConsole.DebugWriteLine("Dump-Media command", "--encoding={0}", encoding);
DicConsole.DebugWriteLine("Dump-Media command", "--first-pregap={0}", firstPregap); 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", "--force={0}", force);
DicConsole.DebugWriteLine("Dump-Media command", "--format={0}", format); 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", "--options={0}", options);
DicConsole.DebugWriteLine("Dump-Media command", "--output={0}", outputPath); DicConsole.DebugWriteLine("Dump-Media command", "--output={0}", outputPath);
DicConsole.DebugWriteLine("Dump-Media command", "--persistent={0}", persistent); 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", "--retry-passes={0}", retryPasses);
DicConsole.DebugWriteLine("Dump-Media command", "--skip={0}", skip); DicConsole.DebugWriteLine("Dump-Media command", "--skip={0}", skip);
DicConsole.DebugWriteLine("Dump-Media command", "--stop-on-error={0}", stopOnError); 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", "--verbose={0}", verbose);
DicConsole.DebugWriteLine("Dump-Media command", "--subchannel={0}", subchannel); 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, var dumper = new Dump(resume, dev, devicePath, outputFormat, retryPasses, force, false, persistent,
stopOnError, resumeClass, dumpLog, encodingClass, outputPrefix, outputPath, stopOnError, resumeClass, dumpLog, encodingClass, outputPrefix, outputPath,
parsedOptions, sidecar, skip, noMetadata, noTrim, firstPregap, fixOffset, debug, parsedOptions, sidecar, skip, metadata, trim, firstPregap, fixOffset, debug,
wantedSubchannel, speed); wantedSubchannel, speed);
dumper.UpdateStatus += Progress.UpdateStatus; dumper.UpdateStatus += Progress.UpdateStatus;