mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
🎨🎨🎨 Removed methods in images that only returned what's already in the ImageInfo structure.
This commit is contained in:
@@ -58,8 +58,8 @@ namespace DiscImageChef.Core
|
||||
List<ulong> checkedLocations = new List<ulong>();
|
||||
|
||||
// Getting all partitions from device (e.g. tracks)
|
||||
if(image.ImageInfo.ImageHasPartitions)
|
||||
foreach(Partition imagePartition in image.GetPartitions())
|
||||
if(image.ImageInfo.HasPartitions)
|
||||
foreach(Partition imagePartition in image.Partitions)
|
||||
{
|
||||
foreach(PartitionPlugin partitionPlugin in plugins.PartPluginsList.Values)
|
||||
if(partitionPlugin.GetInformation(image, out List<Partition> partitions, imagePartition.Start))
|
||||
@@ -130,14 +130,13 @@ namespace DiscImageChef.Core
|
||||
}
|
||||
|
||||
// Be sure that device partitions are not excluded if not mapped by any scheme...
|
||||
if(image.ImageInfo.ImageHasPartitions)
|
||||
if(image.ImageInfo.HasPartitions)
|
||||
{
|
||||
List<ulong> startLocations =
|
||||
childPartitions.Select(detectedPartition => detectedPartition.Start).ToList();
|
||||
|
||||
childPartitions.AddRange(image.GetPartitions()
|
||||
.Where(imagePartition =>
|
||||
!startLocations.Contains(imagePartition.Start)));
|
||||
childPartitions.AddRange(image.Partitions.Where(imagePartition =>
|
||||
!startLocations.Contains(imagePartition.Start)));
|
||||
}
|
||||
|
||||
Partition[] childArray = childPartitions
|
||||
|
||||
@@ -61,20 +61,20 @@ namespace DiscImageChef.Core
|
||||
Checksums = imgChecksums.ToArray(),
|
||||
Image = new ImageType
|
||||
{
|
||||
format = image.GetImageFormat(),
|
||||
format = image.ImageFormat,
|
||||
offset = 0,
|
||||
offsetSpecified = true,
|
||||
Value = Path.GetFileName(imagePath)
|
||||
},
|
||||
Size = fi.Length,
|
||||
Sequence = new SequenceType {MediaTitle = image.GetImageName()}
|
||||
Sequence = new SequenceType {MediaTitle = image.ImageInfo.MediaTitle}
|
||||
}
|
||||
};
|
||||
|
||||
if(image.GetMediaSequence() != 0 && image.GetLastDiskSequence() != 0)
|
||||
if(image.ImageInfo.MediaSequence != 0 && image.ImageInfo.LastMediaSequence != 0)
|
||||
{
|
||||
sidecar.AudioMedia[0].Sequence.MediaSequence = image.GetMediaSequence();
|
||||
sidecar.AudioMedia[0].Sequence.TotalMedia = image.GetMediaSequence();
|
||||
sidecar.AudioMedia[0].Sequence.MediaSequence = image.ImageInfo.MediaSequence;
|
||||
sidecar.AudioMedia[0].Sequence.TotalMedia = image.ImageInfo.LastMediaSequence;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -70,20 +70,20 @@ namespace DiscImageChef.Core
|
||||
Checksums = imgChecksums.ToArray(),
|
||||
Image = new ImageType
|
||||
{
|
||||
format = image.GetImageFormat(),
|
||||
format = image.ImageFormat,
|
||||
offset = 0,
|
||||
offsetSpecified = true,
|
||||
Value = Path.GetFileName(imagePath)
|
||||
},
|
||||
Size = fi.Length,
|
||||
Sequence = new SequenceType {MediaTitle = image.GetImageName()}
|
||||
Sequence = new SequenceType {MediaTitle = image.ImageInfo.MediaTitle}
|
||||
}
|
||||
};
|
||||
|
||||
if(image.GetMediaSequence() != 0 && image.GetLastDiskSequence() != 0)
|
||||
if(image.ImageInfo.MediaSequence != 0 && image.ImageInfo.LastMediaSequence != 0)
|
||||
{
|
||||
sidecar.BlockMedia[0].Sequence.MediaSequence = image.GetMediaSequence();
|
||||
sidecar.BlockMedia[0].Sequence.TotalMedia = image.GetMediaSequence();
|
||||
sidecar.BlockMedia[0].Sequence.MediaSequence = image.ImageInfo.MediaSequence;
|
||||
sidecar.BlockMedia[0].Sequence.TotalMedia = image.ImageInfo.LastMediaSequence;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -253,7 +253,7 @@ namespace DiscImageChef.Core
|
||||
//goto skipImageChecksum;
|
||||
|
||||
uint sectorsToRead = 512;
|
||||
ulong sectors = image.GetSectors();
|
||||
ulong sectors = image.ImageInfo.Sectors;
|
||||
ulong doneSectors = 0;
|
||||
|
||||
InitProgress2();
|
||||
@@ -294,10 +294,10 @@ namespace DiscImageChef.Core
|
||||
|
||||
sidecar.BlockMedia[0].Dimensions = Dimensions.DimensionsFromMediaType(image.ImageInfo.MediaType);
|
||||
|
||||
sidecar.BlockMedia[0].LogicalBlocks = (long)image.GetSectors();
|
||||
sidecar.BlockMedia[0].LogicalBlockSize = (int)image.GetSectorSize();
|
||||
sidecar.BlockMedia[0].LogicalBlocks = (long)image.ImageInfo.Sectors;
|
||||
sidecar.BlockMedia[0].LogicalBlockSize = (int)image.ImageInfo.SectorSize;
|
||||
// TODO: Detect it
|
||||
sidecar.BlockMedia[0].PhysicalBlockSize = (int)image.GetSectorSize();
|
||||
sidecar.BlockMedia[0].PhysicalBlockSize = (int)image.ImageInfo.SectorSize;
|
||||
|
||||
UpdateStatus("Checking filesystems...");
|
||||
|
||||
@@ -342,14 +342,17 @@ namespace DiscImageChef.Core
|
||||
}
|
||||
else
|
||||
{
|
||||
sidecar.BlockMedia[0].FileSystemInformation[0] =
|
||||
new PartitionType {StartSector = 0, EndSector = (int)(image.GetSectors() - 1)};
|
||||
sidecar.BlockMedia[0].FileSystemInformation[0] = new PartitionType
|
||||
{
|
||||
StartSector = 0,
|
||||
EndSector = (int)(image.ImageInfo.Sectors - 1)
|
||||
};
|
||||
|
||||
Partition wholePart = new Partition
|
||||
{
|
||||
Name = "Whole device",
|
||||
Length = image.GetSectors(),
|
||||
Size = image.GetSectors() * image.GetSectorSize()
|
||||
Length = image.ImageInfo.Sectors,
|
||||
Size = image.ImageInfo.Sectors * image.ImageInfo.SectorSize
|
||||
};
|
||||
|
||||
List<FileSystemType> lstFs = new List<FileSystemType>();
|
||||
@@ -559,7 +562,7 @@ namespace DiscImageChef.Core
|
||||
Head = t % image.ImageInfo.Heads,
|
||||
Image = new ImageType
|
||||
{
|
||||
format = scpImage.GetImageFormat(),
|
||||
format = scpImage.ImageFormat,
|
||||
Value = Path.GetFileName(scpFilePath),
|
||||
offset = scpImage.Header.offsets[t]
|
||||
}
|
||||
@@ -575,7 +578,7 @@ namespace DiscImageChef.Core
|
||||
scpBlockTrackType.Format = trkFormat;
|
||||
}
|
||||
|
||||
if(scpImage.Tracks.TryGetValue(t, out SuperCardPro.TrackHeader scpTrack))
|
||||
if(scpImage.ScpTracks.TryGetValue(t, out SuperCardPro.TrackHeader scpTrack))
|
||||
{
|
||||
byte[] trackContents =
|
||||
new byte[scpTrack.Entries.Last().dataOffset +
|
||||
@@ -647,7 +650,7 @@ namespace DiscImageChef.Core
|
||||
Head = kvp.Key % image.ImageInfo.Heads,
|
||||
Image = new ImageType
|
||||
{
|
||||
format = kfImage.GetImageFormat(),
|
||||
format = kfImage.ImageFormat,
|
||||
Value = kfDir
|
||||
? Path
|
||||
.Combine(Path.GetFileName(Path.GetDirectoryName(kvp.Value.GetBasePath())),
|
||||
@@ -720,11 +723,7 @@ namespace DiscImageChef.Core
|
||||
{
|
||||
Cylinder = t / image.ImageInfo.Heads,
|
||||
Head = t % image.ImageInfo.Heads,
|
||||
Image = new ImageType
|
||||
{
|
||||
format = dfiImage.GetImageFormat(),
|
||||
Value = Path.GetFileName(dfiFilePath)
|
||||
}
|
||||
Image = new ImageType {format = dfiImage.ImageFormat, Value = Path.GetFileName(dfiFilePath)}
|
||||
};
|
||||
|
||||
if(dfiBlockTrackType.Cylinder < image.ImageInfo.Cylinders)
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace DiscImageChef.Core
|
||||
Checksums = imgChecksums.ToArray(),
|
||||
Image = new ImageType
|
||||
{
|
||||
format = image.GetImageFormat(),
|
||||
format = image.ImageFormat,
|
||||
offset = 0,
|
||||
offsetSpecified = true,
|
||||
Value = Path.GetFileName(imagePath)
|
||||
|
||||
@@ -67,20 +67,20 @@ namespace DiscImageChef.Core
|
||||
Checksums = imgChecksums.ToArray(),
|
||||
Image = new ImageType
|
||||
{
|
||||
format = image.GetImageFormat(),
|
||||
format = image.ImageFormat,
|
||||
offset = 0,
|
||||
offsetSpecified = true,
|
||||
Value = Path.GetFileName(imagePath)
|
||||
},
|
||||
Size = fi.Length,
|
||||
Sequence = new SequenceType {MediaTitle = image.GetImageName()}
|
||||
Sequence = new SequenceType {MediaTitle = image.ImageInfo.MediaTitle}
|
||||
}
|
||||
};
|
||||
|
||||
if(image.GetMediaSequence() != 0 && image.GetLastDiskSequence() != 0)
|
||||
if(image.ImageInfo.MediaSequence != 0 && image.ImageInfo.LastMediaSequence != 0)
|
||||
{
|
||||
sidecar.OpticalDisc[0].Sequence.MediaSequence = image.GetMediaSequence();
|
||||
sidecar.OpticalDisc[0].Sequence.TotalMedia = image.GetMediaSequence();
|
||||
sidecar.OpticalDisc[0].Sequence.MediaSequence = image.ImageInfo.MediaSequence;
|
||||
sidecar.OpticalDisc[0].Sequence.TotalMedia = image.ImageInfo.LastMediaSequence;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -246,12 +246,12 @@ namespace DiscImageChef.Core
|
||||
|
||||
try
|
||||
{
|
||||
List<Session> sessions = image.GetSessions();
|
||||
List<Session> sessions = image.Sessions;
|
||||
sidecar.OpticalDisc[0].Sessions = sessions?.Count ?? 1;
|
||||
}
|
||||
catch { sidecar.OpticalDisc[0].Sessions = 1; }
|
||||
|
||||
List<Track> tracks = image.GetTracks();
|
||||
List<Track> tracks = image.Tracks;
|
||||
List<TrackType> trksLst = null;
|
||||
if(tracks != null)
|
||||
{
|
||||
@@ -608,8 +608,8 @@ namespace DiscImageChef.Core
|
||||
Serial = image.ImageInfo.DriveSerialNumber,
|
||||
Software = new SoftwareType
|
||||
{
|
||||
Name = image.GetImageApplication(),
|
||||
Version = image.GetImageApplicationVersion()
|
||||
Name = image.ImageInfo.Application,
|
||||
Version = image.ImageInfo.ApplicationVersion
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user