Select only distinct density codes when creating device report.

This commit is contained in:
2019-05-26 00:44:51 +01:00
parent ab670f36b0
commit 5ef78954b0
2 changed files with 26 additions and 5 deletions

View File

@@ -110,9 +110,9 @@ namespace DiscImageChef.Core.Devices.Report
if(mtsh.Value.descriptors[i].densityCodes == null) continue;
DensityCode[] array3 = new DensityCode[mtsh.Value.descriptors[i].densityCodes.Length];
for(int j = 0; j < mtsh.Value.descriptors.Length; j++)
for(int j = 0; j < mtsh.Value.descriptors[i].densityCodes.Length; j++)
array3[j] = new DensityCode {Code = mtsh.Value.descriptors[i].densityCodes[j]};
array2[i].DensityCodes = array3.ToList();
array2[i].DensityCodes = array3.Distinct().ToList();
}
report.SupportedMediaTypes = array2.ToList();
@@ -201,9 +201,9 @@ namespace DiscImageChef.Core.Devices.Report
if(mtsh.Value.descriptors[i].densityCodes == null) continue;
DensityCode[] array2 = new DensityCode[mtsh.Value.descriptors[i].densityCodes.Length];
for(int j = 0; j < mtsh.Value.descriptors.Length; j++)
for(int j = 0; j < mtsh.Value.descriptors[i].densityCodes.Length; j++)
array2[j] = new DensityCode {Code = mtsh.Value.descriptors[i].densityCodes[j]};
array[i].DensityCodes = array2.ToList();
array[i].DensityCodes = array2.Distinct().ToList();
}
seqTest.SupportedMediaTypes = array.ToList();