mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use Aaru Metadata instead of CICM Metadata.
This commit is contained in:
@@ -45,7 +45,6 @@ using Aaru.Localization;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Threading;
|
||||
using ReactiveUI;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.Gui.ViewModels.Windows;
|
||||
|
||||
@@ -611,11 +610,11 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
if(trackChecksum == null)
|
||||
return;
|
||||
|
||||
foreach(ChecksumType chk in trackChecksum.End())
|
||||
foreach(CommonTypes.AaruMetadata.Checksum chk in trackChecksum.End())
|
||||
TrackChecksums.Add(new ChecksumModel
|
||||
{
|
||||
Track = currentTrack.Sequence.ToString(),
|
||||
Algorithm = chk.type.ToString(),
|
||||
Algorithm = chk.Type.ToString(),
|
||||
Hash = chk.Value
|
||||
});
|
||||
});
|
||||
@@ -654,10 +653,10 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
if(mediaChecksum == null)
|
||||
return;
|
||||
|
||||
foreach(ChecksumType chk in mediaChecksum.End())
|
||||
foreach(CommonTypes.AaruMetadata.Checksum chk in mediaChecksum.End())
|
||||
MediaChecksums.Add(new ChecksumModel
|
||||
{
|
||||
Algorithm = chk.type.ToString(),
|
||||
Algorithm = chk.Type.ToString(),
|
||||
Hash = chk.Value
|
||||
});
|
||||
});
|
||||
@@ -754,10 +753,10 @@ public sealed class ImageChecksumViewModel : ViewModelBase
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
foreach(ChecksumType chk in mediaChecksum.End())
|
||||
foreach(CommonTypes.AaruMetadata.Checksum chk in mediaChecksum.End())
|
||||
MediaChecksums.Add(new ChecksumModel
|
||||
{
|
||||
Algorithm = chk.type.ToString(),
|
||||
Algorithm = chk.Type.ToString(),
|
||||
Hash = chk.Value
|
||||
});
|
||||
});
|
||||
|
||||
@@ -42,10 +42,10 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Metadata;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Console;
|
||||
using Aaru.Core;
|
||||
using Aaru.Core.Media;
|
||||
@@ -59,6 +59,7 @@ using MessageBox.Avalonia.Enums;
|
||||
using ReactiveUI;
|
||||
using Schemas;
|
||||
using ImageInfo = Aaru.CommonTypes.Structs.ImageInfo;
|
||||
using Track = Aaru.CommonTypes.Structs.Track;
|
||||
using Version = Aaru.CommonTypes.Interop.Version;
|
||||
|
||||
namespace Aaru.Gui.ViewModels.Windows;
|
||||
@@ -66,68 +67,68 @@ namespace Aaru.Gui.ViewModels.Windows;
|
||||
[SuppressMessage("ReSharper", "AsyncVoidLambda")]
|
||||
public sealed class ImageConvertViewModel : ViewModelBase
|
||||
{
|
||||
readonly IMediaImage _inputFormat;
|
||||
readonly Window _view;
|
||||
bool _cancel;
|
||||
CICMMetadataType _cicmMetadata;
|
||||
bool _cicmXmlFromImageVisible;
|
||||
string _cicmXmlText;
|
||||
bool _closeVisible;
|
||||
string _commentsText;
|
||||
bool _commentsVisible;
|
||||
string _creatorText;
|
||||
bool _creatorVisible;
|
||||
bool _destinationEnabled;
|
||||
string _destinationText;
|
||||
bool _destinationVisible;
|
||||
string _driveFirmwareRevisionText;
|
||||
bool _driveFirmwareRevisionVisible;
|
||||
string _driveManufacturerText;
|
||||
bool _driveManufacturerVisible;
|
||||
string _driveModelText;
|
||||
bool _driveModelVisible;
|
||||
string _driveSerialNumberText;
|
||||
bool _driveSerialNumberVisible;
|
||||
List<DumpHardwareType> _dumpHardware;
|
||||
bool _forceChecked;
|
||||
bool _formatReadOnly;
|
||||
double _lastMediaSequenceValue;
|
||||
bool _lastMediaSequenceVisible;
|
||||
string _mediaBarcodeText;
|
||||
bool _mediaBarcodeVisible;
|
||||
string _mediaManufacturerText;
|
||||
bool _mediaManufacturerVisible;
|
||||
string _mediaModelText;
|
||||
bool _mediaModelVisible;
|
||||
string _mediaPartNumberText;
|
||||
bool _mediaPartNumberVisible;
|
||||
double _mediaSequenceValue;
|
||||
bool _mediaSequenceVisible;
|
||||
string _mediaSerialNumberText;
|
||||
bool _mediaSerialNumberVisible;
|
||||
string _mediaTitleText;
|
||||
bool _mediaTitleVisible;
|
||||
bool _optionsVisible;
|
||||
bool _progress1Visible;
|
||||
bool _progress2Indeterminate;
|
||||
double _progress2MaxValue;
|
||||
string _progress2Text;
|
||||
double _progress2Value;
|
||||
bool _progress2Visible;
|
||||
bool _progressIndeterminate;
|
||||
double _progressMaxValue;
|
||||
string _progressText;
|
||||
double _progressValue;
|
||||
bool _progressVisible;
|
||||
bool _resumeFileFromImageVisible;
|
||||
string _resumeFileText;
|
||||
double _sectorsValue;
|
||||
ImagePluginModel _selectedPlugin;
|
||||
string _sourceText;
|
||||
bool _startVisible;
|
||||
bool _stopEnabled;
|
||||
bool _stopVisible;
|
||||
string _title;
|
||||
readonly IMediaImage _inputFormat;
|
||||
readonly Window _view;
|
||||
bool _cancel;
|
||||
Metadata _aaruMetadata;
|
||||
bool _aaruMetadataFromImageVisible;
|
||||
string _metadataJsonText;
|
||||
bool _closeVisible;
|
||||
string _commentsText;
|
||||
bool _commentsVisible;
|
||||
string _creatorText;
|
||||
bool _creatorVisible;
|
||||
bool _destinationEnabled;
|
||||
string _destinationText;
|
||||
bool _destinationVisible;
|
||||
string _driveFirmwareRevisionText;
|
||||
bool _driveFirmwareRevisionVisible;
|
||||
string _driveManufacturerText;
|
||||
bool _driveManufacturerVisible;
|
||||
string _driveModelText;
|
||||
bool _driveModelVisible;
|
||||
string _driveSerialNumberText;
|
||||
bool _driveSerialNumberVisible;
|
||||
List<DumpHardware> _dumpHardware;
|
||||
bool _forceChecked;
|
||||
bool _formatReadOnly;
|
||||
double _lastMediaSequenceValue;
|
||||
bool _lastMediaSequenceVisible;
|
||||
string _mediaBarcodeText;
|
||||
bool _mediaBarcodeVisible;
|
||||
string _mediaManufacturerText;
|
||||
bool _mediaManufacturerVisible;
|
||||
string _mediaModelText;
|
||||
bool _mediaModelVisible;
|
||||
string _mediaPartNumberText;
|
||||
bool _mediaPartNumberVisible;
|
||||
double _mediaSequenceValue;
|
||||
bool _mediaSequenceVisible;
|
||||
string _mediaSerialNumberText;
|
||||
bool _mediaSerialNumberVisible;
|
||||
string _mediaTitleText;
|
||||
bool _mediaTitleVisible;
|
||||
bool _optionsVisible;
|
||||
bool _progress1Visible;
|
||||
bool _progress2Indeterminate;
|
||||
double _progress2MaxValue;
|
||||
string _progress2Text;
|
||||
double _progress2Value;
|
||||
bool _progress2Visible;
|
||||
bool _progressIndeterminate;
|
||||
double _progressMaxValue;
|
||||
string _progressText;
|
||||
double _progressValue;
|
||||
bool _progressVisible;
|
||||
bool _resumeFileFromImageVisible;
|
||||
string _resumeFileText;
|
||||
double _sectorsValue;
|
||||
ImagePluginModel _selectedPlugin;
|
||||
string _sourceText;
|
||||
bool _startVisible;
|
||||
bool _stopEnabled;
|
||||
bool _stopVisible;
|
||||
string _title;
|
||||
|
||||
public string SourceImageLabel => UI.Source_image;
|
||||
public string OutputFormatLabel => UI.Output_format;
|
||||
@@ -177,7 +178,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
DriveSerialNumberCommand = ReactiveCommand.Create(ExecuteDriveSerialNumberCommand);
|
||||
DriveFirmwareRevisionCommand = ReactiveCommand.Create(ExecuteDriveFirmwareRevisionCommand);
|
||||
CommentsCommand = ReactiveCommand.Create(ExecuteCommentsCommand);
|
||||
CicmXmlFromImageCommand = ReactiveCommand.Create(ExecuteCicmXmlFromImageCommand);
|
||||
AaruMetadataFromImageCommand = ReactiveCommand.Create(ExecuteAaruMetadataFromImageCommand);
|
||||
CicmXmlCommand = ReactiveCommand.Create(ExecuteCicmXmlCommand);
|
||||
ResumeFileFromImageCommand = ReactiveCommand.Create(ExecuteResumeFileFromImageCommand);
|
||||
ResumeFileCommand = ReactiveCommand.Create(ExecuteResumeFileCommand);
|
||||
@@ -211,14 +212,14 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
Plugin = plugin
|
||||
});
|
||||
|
||||
CicmXmlFromImageVisible = inputFormat.CicmMetadata != null;
|
||||
ResumeFileFromImageVisible = inputFormat.DumpHardware?.Any() == true;
|
||||
_cicmMetadata = inputFormat.CicmMetadata;
|
||||
AaruMetadataFromImageVisible = inputFormat.AaruMetadata != null;
|
||||
ResumeFileFromImageVisible = inputFormat.DumpHardware?.Any() == true;
|
||||
_aaruMetadata = inputFormat.AaruMetadata;
|
||||
|
||||
_dumpHardware = inputFormat.DumpHardware?.Any() == true ? inputFormat.DumpHardware : null;
|
||||
|
||||
CicmXmlText = _cicmMetadata == null ? "" : UI._From_image_;
|
||||
ResumeFileText = _dumpHardware == null ? "" : UI._From_image_;
|
||||
MetadataJsonText = _aaruMetadata == null ? "" : UI._From_image_;
|
||||
ResumeFileText = _dumpHardware == null ? "" : UI._From_image_;
|
||||
}
|
||||
|
||||
public string Title
|
||||
@@ -349,10 +350,10 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
set => this.RaiseAndSetIfChanged(ref _commentsText, value);
|
||||
}
|
||||
|
||||
public string CicmXmlText
|
||||
public string MetadataJsonText
|
||||
{
|
||||
get => _cicmXmlText;
|
||||
set => this.RaiseAndSetIfChanged(ref _cicmXmlText, value);
|
||||
get => _metadataJsonText;
|
||||
set => this.RaiseAndSetIfChanged(ref _metadataJsonText, value);
|
||||
}
|
||||
|
||||
public string ResumeFileText
|
||||
@@ -535,10 +536,10 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
set => this.RaiseAndSetIfChanged(ref _driveFirmwareRevisionVisible, value);
|
||||
}
|
||||
|
||||
public bool CicmXmlFromImageVisible
|
||||
public bool AaruMetadataFromImageVisible
|
||||
{
|
||||
get => _cicmXmlFromImageVisible;
|
||||
set => this.RaiseAndSetIfChanged(ref _cicmXmlFromImageVisible, value);
|
||||
get => _aaruMetadataFromImageVisible;
|
||||
set => this.RaiseAndSetIfChanged(ref _aaruMetadataFromImageVisible, value);
|
||||
}
|
||||
|
||||
public bool ResumeFileFromImageVisible
|
||||
@@ -568,7 +569,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
public ReactiveCommand<Unit, Unit> DriveSerialNumberCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> DriveFirmwareRevisionCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> CommentsCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> CicmXmlFromImageCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> AaruMetadataFromImageCommand { get; }
|
||||
public ReactiveCommand<Unit, Task> CicmXmlCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> ResumeFileFromImageCommand { get; }
|
||||
public ReactiveCommand<Unit, Task> ResumeFileCommand { get; }
|
||||
@@ -703,7 +704,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
if(_dumpHardware != null)
|
||||
ProgressMaxValue++;
|
||||
|
||||
if(_cicmMetadata != null)
|
||||
if(_aaruMetadata != null)
|
||||
ProgressMaxValue++;
|
||||
|
||||
ProgressMaxValue++;
|
||||
@@ -836,7 +837,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
};
|
||||
|
||||
if(!_cancel)
|
||||
if(!outputFormat.SetMetadata(metadata))
|
||||
if(!outputFormat.SetImageInfo(metadata))
|
||||
{
|
||||
if(ForceChecked != true)
|
||||
{
|
||||
@@ -1729,19 +1730,19 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
|
||||
ret = false;
|
||||
|
||||
if(_cicmMetadata != null &&
|
||||
if(_aaruMetadata != null &&
|
||||
!_cancel)
|
||||
{
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
ProgressText = UI.Writing_CICM_XML_metadata_to_output_image;
|
||||
ProgressText = UI.Writing_Aaru_Metadata_to_output_image;
|
||||
ProgressValue++;
|
||||
});
|
||||
|
||||
outputFormat.SetCicmMetadata(_cicmMetadata);
|
||||
outputFormat.SetMetadata(_aaruMetadata);
|
||||
|
||||
if(!ret)
|
||||
AaruConsole.WriteLine(UI.Error_0_writing_CICM_XML_metadata_to_output_image, outputFormat.ErrorMessage);
|
||||
AaruConsole.WriteLine(UI.Error_0_writing_Aaru_Metadata_to_output_image, outputFormat.ErrorMessage);
|
||||
}
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
@@ -1998,16 +1999,16 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
|
||||
void ExecuteDriveFirmwareRevisionCommand() => DriveFirmwareRevisionText = _inputFormat.Info.DriveFirmwareRevision;
|
||||
|
||||
void ExecuteCicmXmlFromImageCommand()
|
||||
void ExecuteAaruMetadataFromImageCommand()
|
||||
{
|
||||
CicmXmlText = UI._From_image_;
|
||||
_cicmMetadata = _inputFormat.CicmMetadata;
|
||||
MetadataJsonText = UI._From_image_;
|
||||
_aaruMetadata = _inputFormat.AaruMetadata;
|
||||
}
|
||||
|
||||
async Task ExecuteCicmXmlCommand()
|
||||
{
|
||||
_cicmMetadata = null;
|
||||
CicmXmlText = "";
|
||||
_aaruMetadata = null;
|
||||
MetadataJsonText = "";
|
||||
|
||||
var dlgMetadata = new OpenFileDialog
|
||||
{
|
||||
@@ -2016,7 +2017,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
|
||||
dlgMetadata.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Name = UI.Dialog_CICM_XML_metadata,
|
||||
Name = UI.Dialog_Aaru_Metadata,
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
".xml"
|
||||
@@ -2034,9 +2035,10 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
var sr = new StreamReader(result[0]);
|
||||
_cicmMetadata = (CICMMetadataType)sidecarXs.Deserialize(sr);
|
||||
|
||||
// _aaruMetadata = (CICMMetadataType)sidecarXs.Deserialize(sr);
|
||||
sr.Close();
|
||||
CicmXmlText = result[0];
|
||||
MetadataJsonText = result[0];
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -2063,7 +2065,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
||||
|
||||
dlgMetadata.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Name = UI.Dialog_CICM_XML_metadata,
|
||||
Name = UI.Dialog_Aaru_Metadata,
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
".xml"
|
||||
|
||||
@@ -36,9 +36,11 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.Console;
|
||||
using Aaru.Core;
|
||||
@@ -46,7 +48,6 @@ using Aaru.Localization;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Threading;
|
||||
using ReactiveUI;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.Gui.ViewModels.Windows;
|
||||
|
||||
@@ -88,7 +89,7 @@ public sealed class ImageSidecarViewModel : ViewModelBase
|
||||
_encoding = encoding;
|
||||
|
||||
DestinationText = Path.Combine(Path.GetDirectoryName(imageSource) ?? "",
|
||||
Path.GetFileNameWithoutExtension(imageSource) + ".cicm.xml");
|
||||
Path.GetFileNameWithoutExtension(imageSource) + ".metadata.json");
|
||||
|
||||
DestinationEnabled = true;
|
||||
StartVisible = true;
|
||||
@@ -250,15 +251,19 @@ public sealed class ImageSidecarViewModel : ViewModelBase
|
||||
_sidecarClass.InitProgressEvent2 += InitProgress2;
|
||||
_sidecarClass.UpdateProgressEvent2 += UpdateProgress2;
|
||||
_sidecarClass.EndProgressEvent2 += EndProgress2;
|
||||
CICMMetadataType sidecar = _sidecarClass.Create();
|
||||
Metadata sidecar = _sidecarClass.Create();
|
||||
|
||||
AaruConsole.WriteLine(Localization.Core.Writing_metadata_sidecar);
|
||||
|
||||
var xmlFs = new FileStream(DestinationText, FileMode.Create);
|
||||
var jsonFs = new FileStream(DestinationText, FileMode.Create);
|
||||
|
||||
var xmlSer = new XmlSerializer(typeof(CICMMetadataType));
|
||||
xmlSer.Serialize(xmlFs, sidecar);
|
||||
xmlFs.Close();
|
||||
await JsonSerializer.SerializeAsync(jsonFs, sidecar, new JsonSerializerOptions
|
||||
{
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||
WriteIndented = true
|
||||
});
|
||||
|
||||
jsonFs.Close();
|
||||
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
@@ -339,10 +344,10 @@ public sealed class ImageSidecarViewModel : ViewModelBase
|
||||
|
||||
dlgDestination.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Name = UI.Dialog_CICM_XML_metadata,
|
||||
Name = UI.Dialog_Aaru_Metadata,
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.xml"
|
||||
"*.json"
|
||||
})
|
||||
});
|
||||
|
||||
@@ -356,7 +361,7 @@ public sealed class ImageSidecarViewModel : ViewModelBase
|
||||
}
|
||||
|
||||
if(string.IsNullOrEmpty(Path.GetExtension(result)))
|
||||
result += ".xml";
|
||||
result += ".json";
|
||||
|
||||
DestinationText = result;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
public string CalculateEntropyLabel => UI.ButtonLabel_Calculate_entropy;
|
||||
public string VerifyImageLabel => UI.ButtonLabel_Verify;
|
||||
public string ChecksumImageLabel => UI.ButtonLabel_Checksum;
|
||||
public string CreateSidecarLabel => UI.ButtonLabel_Create_CICM_XML_sidecar;
|
||||
public string CreateSidecarLabel => UI.ButtonLabel_Create_Aaru_Metadata_sidecar;
|
||||
public string ViewImageSectorsLabel => UI.ButtonLabel_View_sectors;
|
||||
public string DecodeImageMediaTagsLabel => UI.ButtonLabel_Decode_media_tags;
|
||||
|
||||
@@ -577,9 +577,9 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
Path = result[0],
|
||||
Icon = _assets.Exists(mediaResource)
|
||||
? new Bitmap(_assets.Open(mediaResource))
|
||||
: imageFormat.Info.XmlMediaType == XmlMediaType.BlockMedia
|
||||
: imageFormat.Info.MetadataMediaType == MetadataMediaType.BlockMedia
|
||||
? _genericHddIcon
|
||||
: imageFormat.Info.XmlMediaType == XmlMediaType.OpticalDisc
|
||||
: imageFormat.Info.MetadataMediaType == MetadataMediaType.OpticalDisc
|
||||
? _genericOpticalIcon
|
||||
: _genericFolderIcon,
|
||||
FileName = Path.GetFileName(result[0]),
|
||||
@@ -655,11 +655,11 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
var filesystemModel = new FileSystemModel
|
||||
{
|
||||
VolumeName =
|
||||
plugin.XmlFsType.VolumeName is null ? $"{plugin.XmlFsType.Type}"
|
||||
: $"{plugin.XmlFsType.VolumeName} ({plugin.XmlFsType.Type})",
|
||||
plugin.Metadata.VolumeName is null ? $"{plugin.Metadata.Type}"
|
||||
: $"{plugin.Metadata.VolumeName} ({plugin.Metadata.Type})",
|
||||
Filesystem = plugin,
|
||||
ReadOnlyFilesystem = fsPlugin,
|
||||
ViewModel = new FileSystemViewModel(plugin.XmlFsType, information)
|
||||
ViewModel = new FileSystemViewModel(plugin.Metadata, information)
|
||||
};
|
||||
|
||||
// TODO: Trap expanding item
|
||||
@@ -675,7 +675,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
Statistics.AddCommand("ls");
|
||||
}
|
||||
|
||||
Statistics.AddFilesystem(plugin.XmlFsType.Type);
|
||||
Statistics.AddFilesystem(plugin.Metadata.Type);
|
||||
partitionModel.FileSystems.Add(filesystemModel);
|
||||
}
|
||||
}
|
||||
@@ -722,11 +722,11 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
|
||||
var filesystemModel = new FileSystemModel
|
||||
{
|
||||
VolumeName = plugin.XmlFsType.VolumeName is null ? $"{plugin.XmlFsType.Type}"
|
||||
: $"{plugin.XmlFsType.VolumeName} ({plugin.XmlFsType.Type})",
|
||||
VolumeName = plugin.Metadata.VolumeName is null ? $"{plugin.Metadata.Type}"
|
||||
: $"{plugin.Metadata.VolumeName} ({plugin.Metadata.Type})",
|
||||
Filesystem = plugin,
|
||||
ReadOnlyFilesystem = fsPlugin,
|
||||
ViewModel = new FileSystemViewModel(plugin.XmlFsType, information)
|
||||
ViewModel = new FileSystemViewModel(plugin.Metadata, information)
|
||||
};
|
||||
|
||||
// TODO: Trap expanding item
|
||||
@@ -742,7 +742,7 @@ public sealed class MainWindowViewModel : ViewModelBase
|
||||
Statistics.AddCommand("ls");
|
||||
}
|
||||
|
||||
Statistics.AddFilesystem(plugin.XmlFsType.Type);
|
||||
Statistics.AddFilesystem(plugin.Metadata.Type);
|
||||
imageModel.PartitionSchemesOrFileSystems.Add(filesystemModel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Metadata;
|
||||
@@ -63,6 +64,8 @@ using MessageBox.Avalonia.Enums;
|
||||
using ReactiveUI;
|
||||
using Schemas;
|
||||
using DeviceInfo = Aaru.Core.Devices.Info.DeviceInfo;
|
||||
using Dump = Aaru.Core.Devices.Dumping.Dump;
|
||||
using File = System.IO.File;
|
||||
using MediaType = Aaru.CommonTypes.MediaType;
|
||||
|
||||
namespace Aaru.Gui.ViewModels.Windows;
|
||||
@@ -100,7 +103,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
double _retries;
|
||||
EncodingModel _selectedEncoding;
|
||||
ImagePluginModel _selectedPlugin;
|
||||
CICMMetadataType _sidecar;
|
||||
Metadata _sidecar;
|
||||
double _skipped;
|
||||
bool _startVisible;
|
||||
bool _stopEnabled;
|
||||
@@ -252,7 +255,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
public string ResumeLabel => UI.Create_use_resume_mapfile;
|
||||
public string Track1PregapLabel => UI.Try_to_read_track_1_pregap;
|
||||
public string SkippedLabel => UI.Skipped_sectors_on_error;
|
||||
public string SidecarLabel => UI.Create_CICM_XML_metadata_sidecar;
|
||||
public string SidecarLabel => UI.Create_Aaru_Metadata_sidecar;
|
||||
public string TrimLabel => UI.Trim_errors_from_skipped_sectors;
|
||||
public string ExistingMetadataLabel => UI.Take_metadata_from_existing_CICM_XML_sidecar;
|
||||
public string EncodingLabel => UI.Encoding_to_use_on_metadata_sidecar_creation;
|
||||
@@ -509,7 +512,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
|
||||
dlgMetadata.Filters?.Add(new FileDialogFilter
|
||||
{
|
||||
Name = UI.Dialog_CICM_XML_metadata,
|
||||
Name = UI.Dialog_Aaru_Metadata,
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
".xml"
|
||||
@@ -530,7 +533,8 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
try
|
||||
{
|
||||
var sr = new StreamReader(result[0]);
|
||||
_sidecar = (CICMMetadataType)sidecarXs.Deserialize(sr);
|
||||
|
||||
// _sidecar = (CICMMetadataType)sidecarXs.Deserialize(sr);
|
||||
sr.Close();
|
||||
}
|
||||
catch
|
||||
|
||||
Reference in New Issue
Block a user