Do not set ISO identifiers in XML metadata if they are empty.

This commit is contained in:
2019-02-12 18:57:20 +00:00
parent b17c7fc80f
commit 6f9ec398ab
2 changed files with 34 additions and 19 deletions

View File

@@ -64,7 +64,7 @@ namespace DiscImageChef.Core
// For fast debugging, skip checksum // For fast debugging, skip checksum
//goto skipImageChecksum; //goto skipImageChecksum;
/*
byte[] data; byte[] data;
long position = 0; long position = 0;
InitProgress(); InitProgress();
@@ -90,7 +90,7 @@ namespace DiscImageChef.Core
// For fast debugging, skip checksum // For fast debugging, skip checksum
//skipImageChecksum: //skipImageChecksum:
EndProgress();*/ EndProgress();
fs.Close(); fs.Close();
List<ChecksumType> imgChecksums = imgChkWorker.End(); List<ChecksumType> imgChecksums = imgChkWorker.End();

View File

@@ -756,30 +756,45 @@ namespace DiscImageChef.Filesystems.ISO9660
{ {
XmlFsType.VolumeName = decodedJolietVd.VolumeIdentifier; XmlFsType.VolumeName = decodedJolietVd.VolumeIdentifier;
if(decodedJolietVd.SystemIdentifier == null || if(string.IsNullOrEmpty(decodedJolietVd.SystemIdentifier) ||
decodedVd.SystemIdentifier.Length > decodedJolietVd.SystemIdentifier.Length) decodedVd.SystemIdentifier.Length > decodedJolietVd.SystemIdentifier.Length)
XmlFsType.SystemIdentifier = decodedVd.SystemIdentifier; XmlFsType.SystemIdentifier = decodedVd.SystemIdentifier;
else XmlFsType.SystemIdentifier = decodedJolietVd.SystemIdentifier; else
XmlFsType.SystemIdentifier = string.IsNullOrEmpty(decodedJolietVd.SystemIdentifier)
? null
: decodedJolietVd.SystemIdentifier;
if(decodedJolietVd.VolumeSetIdentifier == null || decodedVd.VolumeSetIdentifier.Length > if(string.IsNullOrEmpty(decodedJolietVd.VolumeSetIdentifier) || decodedVd.VolumeSetIdentifier.Length >
decodedJolietVd.VolumeSetIdentifier.Length) decodedJolietVd.VolumeSetIdentifier.Length)
XmlFsType.VolumeSetIdentifier = decodedVd.VolumeSetIdentifier; XmlFsType.VolumeSetIdentifier = decodedVd.VolumeSetIdentifier;
else XmlFsType.VolumeSetIdentifier = decodedJolietVd.VolumeSetIdentifier; else
XmlFsType.VolumeSetIdentifier = string.IsNullOrEmpty(decodedJolietVd.VolumeSetIdentifier)
? null
: decodedJolietVd.VolumeSetIdentifier;
if(decodedJolietVd.PublisherIdentifier == null || decodedVd.PublisherIdentifier.Length > if(string.IsNullOrEmpty(decodedJolietVd.PublisherIdentifier) || decodedVd.PublisherIdentifier.Length >
decodedJolietVd.PublisherIdentifier.Length) decodedJolietVd.PublisherIdentifier.Length)
XmlFsType.PublisherIdentifier = decodedVd.PublisherIdentifier; XmlFsType.PublisherIdentifier = decodedVd.PublisherIdentifier;
else XmlFsType.PublisherIdentifier = decodedJolietVd.PublisherIdentifier; else
XmlFsType.PublisherIdentifier = string.IsNullOrEmpty(decodedJolietVd.PublisherIdentifier)
? null
: decodedJolietVd.PublisherIdentifier;
if(decodedJolietVd.DataPreparerIdentifier == null || decodedVd.DataPreparerIdentifier.Length > if(string.IsNullOrEmpty(decodedJolietVd.DataPreparerIdentifier) ||
decodedJolietVd.DataPreparerIdentifier.Length) decodedVd.DataPreparerIdentifier.Length > decodedJolietVd.DataPreparerIdentifier.Length)
XmlFsType.DataPreparerIdentifier = decodedVd.DataPreparerIdentifier; XmlFsType.DataPreparerIdentifier = decodedVd.DataPreparerIdentifier;
else XmlFsType.DataPreparerIdentifier = decodedJolietVd.DataPreparerIdentifier; else
XmlFsType.DataPreparerIdentifier = string.IsNullOrEmpty(decodedJolietVd.DataPreparerIdentifier)
? null
: decodedJolietVd.DataPreparerIdentifier;
if(decodedJolietVd.ApplicationIdentifier == null || decodedVd.ApplicationIdentifier.Length > if(string.IsNullOrEmpty(decodedJolietVd.ApplicationIdentifier) ||
decodedJolietVd.ApplicationIdentifier.Length) decodedVd.ApplicationIdentifier.Length > decodedJolietVd.ApplicationIdentifier.Length)
XmlFsType.ApplicationIdentifier = decodedVd.ApplicationIdentifier; XmlFsType.ApplicationIdentifier = decodedVd.ApplicationIdentifier;
else XmlFsType.ApplicationIdentifier = decodedJolietVd.ApplicationIdentifier; else
XmlFsType.ApplicationIdentifier = string.IsNullOrEmpty(decodedJolietVd.ApplicationIdentifier)
? null
: decodedJolietVd.ApplicationIdentifier;
XmlFsType.CreationDate = decodedJolietVd.CreationTime; XmlFsType.CreationDate = decodedJolietVd.CreationTime;
XmlFsType.CreationDateSpecified = true; XmlFsType.CreationDateSpecified = true;