Pass filter UUID to sidecar creation, use it to detect filters

and calculate checksums of disk image and its contents
	correctly.
This commit is contained in:
2017-06-22 01:11:50 +01:00
parent 1df2589b39
commit f5cca3c779
4 changed files with 51 additions and 4 deletions

View File

@@ -99,7 +99,7 @@ namespace DiscImageChef.Core
UpdateStatusEvent(string.Format(text, args));
}
public static CICMMetadataType Create(ImagePlugin image, string imagePath)
public static CICMMetadataType Create(ImagePlugin image, string imagePath, System.Guid filterId)
{
CICMMetadataType sidecar = new CICMMetadataType();
PluginBase plugins = new PluginBase();
@@ -421,7 +421,8 @@ namespace DiscImageChef.Core
ulong doneSectors = 0;
// If there is only one track, and it's the same as the image file (e.g. ".iso" files), don't re-checksum.
if(image.PluginUUID == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
if(image.PluginUUID == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000") &&
filterId == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
{
xmlTrk.Checksums = sidecar.OpticalDisc[0].Checksums;
}
@@ -786,7 +787,8 @@ namespace DiscImageChef.Core
}
// If there is only one track, and it's the same as the image file (e.g. ".iso" files), don't re-checksum.
if(image.PluginUUID == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
if(image.PluginUUID == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000") &&
filterId == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
{
sidecar.BlockMedia[0].ContentChecksums = sidecar.BlockMedia[0].Checksums;
}

View File

@@ -0,0 +1,41 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : SaveDskF.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Component
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2017 Natalia Portillo
// ****************************************************************************/
using System;
namespace DiscImageChef.DiscImages
{
public class SaveDskF
{
public SaveDskF()
{
}
}
}

View File

@@ -1,3 +1,7 @@
* Commands/CreateSidecar.cs:
Pass filter UUID to sidecar creation, use it to detect filters and
calculate checksums of disk image and its contents correctly.
* Options.cs:
* Commands/DumpMedia.cs:
Implemented resume mapfile support.

View File

@@ -101,7 +101,7 @@ namespace DiscImageChef.Commands
Sidecar.EndProgressEvent2 += Progress.EndProgress2;
Sidecar.UpdateStatusEvent += Progress.UpdateStatus;
CICMMetadataType sidecar = Sidecar.Create(_imageFormat, options.InputFile);
CICMMetadataType sidecar = Sidecar.Create(_imageFormat, options.InputFile, inputFilter.UUID);
DicConsole.WriteLine("Writing metadata sidecar");