Do not throw an exception on CHD when tried to access optical structures on a non-optical image.

This commit is contained in:
2021-09-14 01:35:29 +01:00
parent df0dbe33d7
commit 25df31338a

View File

@@ -34,7 +34,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Aaru.CommonTypes; using Aaru.CommonTypes;
using Aaru.CommonTypes.Exceptions;
using Aaru.CommonTypes.Structs; using Aaru.CommonTypes.Structs;
using Schemas; using Schemas;
@@ -47,37 +46,17 @@ namespace Aaru.DiscImages
/// <inheritdoc /> /// <inheritdoc />
public string Name => "MAME Compressed Hunks of Data"; public string Name => "MAME Compressed Hunks of Data";
/// <inheritdoc /> /// <inheritdoc />
public Guid Id => new Guid("0D50233A-08BD-47D4-988B-27EAA0358597"); public Guid Id => new("0D50233A-08BD-47D4-988B-27EAA0358597");
/// <inheritdoc /> /// <inheritdoc />
public string Format => "Compressed Hunks of Data"; public string Format => "Compressed Hunks of Data";
/// <inheritdoc /> /// <inheritdoc />
public string Author => "Natalia Portillo"; public string Author => "Natalia Portillo";
/// <inheritdoc /> /// <inheritdoc />
public List<Partition> Partitions public List<Partition> Partitions => _isHdd ? null : _partitions;
{
get
{
if(_isHdd)
throw new
FeaturedNotSupportedByDiscImageException("Cannot access optical tracks on a hard disk image");
return _partitions;
}
}
/// <inheritdoc /> /// <inheritdoc />
public List<Track> Tracks public List<Track> Tracks => _isHdd ? null : _tracks.Values.ToList();
{
get
{
if(_isHdd)
throw new
FeaturedNotSupportedByDiscImageException("Cannot access optical tracks on a hard disk image");
return _tracks.Values.ToList();
}
}
/// <inheritdoc /> /// <inheritdoc />
public List<Session> Sessions public List<Session> Sessions
@@ -85,8 +64,7 @@ namespace Aaru.DiscImages
get get
{ {
if(_isHdd) if(_isHdd)
throw new return null;
FeaturedNotSupportedByDiscImageException("Cannot access optical sessions on a hard disk image");
throw new NotImplementedException(); throw new NotImplementedException();
} }