mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
41
DiscImageChef.DiscImages/SaveDskF.cs
Normal file
41
DiscImageChef.DiscImages/SaveDskF.cs
Normal 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()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user