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;
}