mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Change CDRWin media type
This commit is contained in:
@@ -172,6 +172,7 @@ namespace Aaru.DiscImages
|
||||
const string REGEX_TRURIP_TRACK_SHA1 = @"\bREM\s+(Gap|Trk)\s+(?<number>\d{2}):\s+[\da-f]{40}$";
|
||||
const string REGEX_TRURIP_TRACK_UNKNOWN = @"\bREM\s+(Gap|Trk)\s+(?<number>\d{2}):\s+[\da-f]{8,}$";
|
||||
const string REGEX_DIC_MEDIA_TYPE = @"\bREM\s+METADATA DIC MEDIA-TYPE:\s+(?<mediatype>.+)$";
|
||||
const string REGEX_AARU_MEDIA_TYPE = @"\bREM\s+METADATA AARU MEDIA-TYPE:\s+(?<mediatype>.+)$";
|
||||
const string REGEX_APPLICATION_VERSION = @"\bREM\s+Ripping Tool Version:\s+(?<application>.+)$";
|
||||
const string REGEX_DUMP_EXTENT =
|
||||
@"\bREM\s+METADATA DUMP EXTENT:\s+(?<application>.+)\s+\|\s+(?<version>.+)\s+\|\s+(?<os>.+)\s+\|\s+(?<manufacturer>.+)\s+\|\s+(?<model>.+)\s+\|\s+(?<firmware>.+)\s+\|\s+(?<serial>.+)\s+\|\s+(?<start>\d+):(?<end>\d+)$";
|
||||
|
||||
@@ -101,6 +101,7 @@ namespace Aaru.DiscImages
|
||||
var regexDicMediaType = new Regex(REGEX_DIC_MEDIA_TYPE);
|
||||
var regexApplicationVersion = new Regex(REGEX_APPLICATION_VERSION);
|
||||
var regexDumpExtent = new Regex(REGEX_DUMP_EXTENT);
|
||||
var regexAaruMediaType = new Regex(REGEX_AARU_MEDIA_TYPE);
|
||||
|
||||
// Initialize all RegEx matches
|
||||
Match matchTrack;
|
||||
@@ -170,6 +171,7 @@ namespace Aaru.DiscImages
|
||||
Match matchDicMediaType = regexDicMediaType.Match(line);
|
||||
Match matchApplicationVersion = regexApplicationVersion.Match(line);
|
||||
Match matchDumpExtent = regexDumpExtent.Match(line);
|
||||
Match matchAaruMediaType = regexAaruMediaType.Match(line);
|
||||
|
||||
if(inTruripDiscHash)
|
||||
{
|
||||
@@ -317,7 +319,15 @@ namespace Aaru.DiscImages
|
||||
AaruConsole.DebugWriteLine("CDRWin plugin", "Found REM METADATA DIC MEDIA-TYPE at line {0}",
|
||||
lineNumber);
|
||||
|
||||
_discImage.DicMediaType = matchDicMediaType.Groups[1].Value;
|
||||
_discImage.AaruMediaType = matchDicMediaType.Groups[1].Value;
|
||||
}
|
||||
else if(matchAaruMediaType.Success &&
|
||||
!inTrack)
|
||||
{
|
||||
AaruConsole.DebugWriteLine("CDRWin plugin", "Found REM METADATA AARU MEDIA-TYPE at line {0}",
|
||||
lineNumber);
|
||||
|
||||
_discImage.AaruMediaType = matchAaruMediaType.Groups[1].Value;
|
||||
}
|
||||
else if(matchDiskType.Success &&
|
||||
!inTrack)
|
||||
@@ -794,8 +804,8 @@ namespace Aaru.DiscImages
|
||||
_discImage.Tracks.Add(cueTracks[t - 1]);
|
||||
}
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(_discImage.DicMediaType) &&
|
||||
Enum.TryParse(_discImage.DicMediaType, true, out MediaType mediaType))
|
||||
if(!string.IsNullOrWhiteSpace(_discImage.AaruMediaType) &&
|
||||
Enum.TryParse(_discImage.AaruMediaType, true, out MediaType mediaType))
|
||||
{
|
||||
_discImage.MediaType = mediaType;
|
||||
}
|
||||
|
||||
@@ -131,8 +131,8 @@ namespace Aaru.DiscImages
|
||||
public bool IsTrurip;
|
||||
/// <summary>Disc image hashes</summary>
|
||||
public Dictionary<string, string> DiscHashes;
|
||||
/// <summary>DIC media type</summary>
|
||||
public string DicMediaType;
|
||||
/// <summary>Aaru media type</summary>
|
||||
public string AaruMediaType;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -441,7 +441,7 @@ namespace Aaru.DiscImages
|
||||
|
||||
_descriptorStream.WriteLine("REM ORIGINAL MEDIA-TYPE: {0}", MediaTypeToCdrwinType(_imageInfo.MediaType));
|
||||
|
||||
_descriptorStream.WriteLine("REM METADATA DIC MEDIA-TYPE: {0}", _imageInfo.MediaType);
|
||||
_descriptorStream.WriteLine("REM METADATA AARU MEDIA-TYPE: {0}", _imageInfo.MediaType);
|
||||
|
||||
if(!string.IsNullOrEmpty(_imageInfo.Application))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user