Skip to content

Commit

Permalink
[SIDECAR] Fix creation of metadata sidecar for optical media images n…
Browse files Browse the repository at this point in the history
…ot mounting supported filesystems.
  • Loading branch information
claunia committed Dec 31, 2024
1 parent 5863664 commit 40f4650
Showing 1 changed file with 42 additions and 6 deletions.
48 changes: 42 additions & 6 deletions Aaru.Core/Sidecar/OpticalDisc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,27 @@ void OpticalDisc(IOpticalMediaImage image, Guid filterId, string imagePath, File

if(!fs.Identify(image, partition)) continue;

fs.GetInformation(image, partition, encoding, out _, out FileSystem fsMetadata);
lstFs.Add(fsMetadata);
Statistics.AddFilesystem(fsMetadata.Type);
FileSystem fsMetadata = new();

if(fs is IReadOnlyFilesystem rofs &&
rofs.Mount(image, partition, encoding, null, null) == ErrorNumber.NoError)
{
UpdateStatus(string.Format(Localization.Core.Mounting_0, rofs.Metadata.Type));

rofs.Metadata.Contents = Files(rofs);

lstFs.Add(rofs.Metadata);
Statistics.AddFilesystem(rofs.Metadata.Type);

rofs.Unmount();
}
else
{
fs.GetInformation(image, partition, encoding, out _, out fsMetadata);

lstFs.Add(fsMetadata);
Statistics.AddFilesystem(fsMetadata.Type);
}

dskType = fsMetadata.Type switch
{
Expand Down Expand Up @@ -597,9 +615,27 @@ void OpticalDisc(IOpticalMediaImage image, Guid filterId, string imagePath, File

if(!fs.Identify(image, xmlPart)) continue;

fs.GetInformation(image, xmlPart, encoding, out _, out FileSystem fsMetadata);
lstFs.Add(fsMetadata);
Statistics.AddFilesystem(fsMetadata.Type);
FileSystem fsMetadata = new();

if(fs is IReadOnlyFilesystem rofs &&
rofs.Mount(image, xmlPart, encoding, null, null) == ErrorNumber.NoError)
{
UpdateStatus(string.Format(Localization.Core.Mounting_0, rofs.Metadata.Type));

rofs.Metadata.Contents = Files(rofs);

lstFs.Add(rofs.Metadata);
Statistics.AddFilesystem(rofs.Metadata.Type);

rofs.Unmount();
}
else
{
fs.GetInformation(image, xmlPart, encoding, out _, out fsMetadata);

lstFs.Add(fsMetadata);
Statistics.AddFilesystem(fsMetadata.Type);
}

dskType = fsMetadata.Type switch
{
Expand Down

0 comments on commit 40f4650

Please sign in to comment.