Detect when DVD book type is different from drive's firmware profile.

This commit is contained in:
2021-06-23 14:48:22 +01:00
parent f11080610d
commit a77fb96a00
11 changed files with 51 additions and 48 deletions

View File

@@ -382,7 +382,7 @@ namespace Aaru.Gui.ViewModels.Panels
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DVD_PFI) == true)
{
dvdPfi = imageFormat.ReadDiskTag(MediaTagType.DVD_PFI);
decodedPfi = PFI.Decode(dvdPfi);
decodedPfi = PFI.Decode(dvdPfi, imageFormat.Info.MediaType);
}
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DVD_DMI) == true)

View File

@@ -32,6 +32,7 @@
using System.Collections.ObjectModel;
using System.Text;
using Aaru.CommonTypes;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
using Aaru.CommonTypes.Structs.Devices.SCSI;
@@ -57,17 +58,19 @@ namespace Aaru.Gui.ViewModels.Windows
{
public sealed class DecodeMediaTagsViewModel : ViewModelBase
{
const int HEX_COLUMNS = 32;
string _decodedText;
bool _decodedVisible;
string _hexViewText;
MediaTagModel _selectedTag;
const int HEX_COLUMNS = 32;
string _decodedText;
bool _decodedVisible;
string _hexViewText;
readonly MediaType _mediaType;
MediaTagModel _selectedTag;
public DecodeMediaTagsViewModel([NotNull] IMediaImage inputFormat)
{
TagsList = new ObservableCollection<MediaTagModel>();
_mediaType = inputFormat.Info.MediaType;
foreach(MediaTagType tag in inputFormat.Info.ReadableMediaTags)
try
{
@@ -140,7 +143,7 @@ namespace Aaru.Gui.ViewModels.Windows
break;
case MediaTagType.DVD_PFI:
DecodedText = PFI.Prettify(value.Data);
DecodedText = PFI.Prettify(value.Data, _mediaType);
break;
case MediaTagType.DVD_CMI:
@@ -156,11 +159,11 @@ namespace Aaru.Gui.ViewModels.Windows
break;
case MediaTagType.DVDR_PFI:
DecodedText = PFI.Prettify(value.Data);
DecodedText = PFI.Prettify(value.Data, _mediaType);
break;
case MediaTagType.HDDVD_MediumStatus:
DecodedText = PFI.Prettify(value.Data);
DecodedText = PFI.Prettify(value.Data, _mediaType);
break;
case MediaTagType.BD_DI: