mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Only encode artifacts if we're outputting JSON
This commit is contained in:
@@ -205,7 +205,7 @@ namespace MPF.Aaru
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, Drive drive)
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, Drive drive, bool includeArtifacts)
|
||||
{
|
||||
// TODO: Fill in submission info specifics for Aaru
|
||||
string outputDirectory = Path.GetDirectoryName(basePath);
|
||||
@@ -365,19 +365,22 @@ namespace MPF.Aaru
|
||||
break;
|
||||
}
|
||||
|
||||
// Fill in any artifacts that exist, Base64-encoded
|
||||
if (File.Exists(basePath + ".cicm.xml"))
|
||||
info.Artifacts["cicm"] = GetBase64(GetFullFile(basePath + ".cicm.xml"));
|
||||
if (File.Exists(basePath + ".ibg"))
|
||||
info.Artifacts["ibg"] = Convert.ToBase64String(File.ReadAllBytes(basePath + ".ibg"));
|
||||
if (File.Exists(basePath + ".log"))
|
||||
info.Artifacts["log"] = GetBase64(GetFullFile(basePath + ".log"));
|
||||
if (File.Exists(basePath + ".mhddlog.bin"))
|
||||
info.Artifacts["mhddlog_bin"] = Convert.ToBase64String(File.ReadAllBytes(basePath + ".mhddlog.bin"));
|
||||
if (File.Exists(basePath + ".resume.xml"))
|
||||
info.Artifacts["resume"] = GetBase64(GetFullFile(basePath + ".resume.xml"));
|
||||
if (File.Exists(basePath + ".sub.log"))
|
||||
info.Artifacts["sub_log"] = GetBase64(GetFullFile(basePath + ".sub.log"));
|
||||
// Fill in any artifacts that exist, Base64-encoded, if we need to
|
||||
if (includeArtifacts)
|
||||
{
|
||||
if (File.Exists(basePath + ".cicm.xml"))
|
||||
info.Artifacts["cicm"] = GetBase64(GetFullFile(basePath + ".cicm.xml"));
|
||||
if (File.Exists(basePath + ".ibg"))
|
||||
info.Artifacts["ibg"] = Convert.ToBase64String(File.ReadAllBytes(basePath + ".ibg"));
|
||||
if (File.Exists(basePath + ".log"))
|
||||
info.Artifacts["log"] = GetBase64(GetFullFile(basePath + ".log"));
|
||||
if (File.Exists(basePath + ".mhddlog.bin"))
|
||||
info.Artifacts["mhddlog_bin"] = Convert.ToBase64String(File.ReadAllBytes(basePath + ".mhddlog.bin"));
|
||||
if (File.Exists(basePath + ".resume.xml"))
|
||||
info.Artifacts["resume"] = GetBase64(GetFullFile(basePath + ".resume.xml"));
|
||||
if (File.Exists(basePath + ".sub.log"))
|
||||
info.Artifacts["sub_log"] = GetBase64(GetFullFile(basePath + ".sub.log"));
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace MPF.CleanRip
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, Drive drive)
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, Drive drive, bool includeArtifacts)
|
||||
{
|
||||
info.TracksAndWriteOffsets.ClrMameProData = GetCleanripDatfile(basePath + ".iso", basePath + "-dumpinfo.txt");
|
||||
|
||||
@@ -89,11 +89,14 @@ namespace MPF.CleanRip
|
||||
break;
|
||||
}
|
||||
|
||||
// Fill in any artifacts that exist, Base64-encoded
|
||||
if (File.Exists(basePath + ".bca"))
|
||||
info.Artifacts["bca"] = GetBase64(GetFullFile(basePath + ".bca", binary: true));
|
||||
if (File.Exists(basePath + "-dumpinfo.txt"))
|
||||
info.Artifacts["dumpinfo"] = GetBase64(GetFullFile(basePath + "-dumpinfo.txt"));
|
||||
// Fill in any artifacts that exist, Base64-encoded, if we need to
|
||||
if (includeArtifacts)
|
||||
{
|
||||
if (File.Exists(basePath + ".bca"))
|
||||
info.Artifacts["bca"] = GetBase64(GetFullFile(basePath + ".bca", binary: true));
|
||||
if (File.Exists(basePath + "-dumpinfo.txt"))
|
||||
info.Artifacts["dumpinfo"] = GetBase64(GetFullFile(basePath + "-dumpinfo.txt"));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace MPF.DD
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, Drive drive)
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, Drive drive, bool includeArtifacts)
|
||||
{
|
||||
// TODO: Fill in submission info specifics for DD
|
||||
string outputDirectory = Path.GetDirectoryName(basePath);
|
||||
|
||||
@@ -123,7 +123,8 @@ namespace MPF.Data
|
||||
/// <param name="submissionInfo">Base submission info to fill in specifics for</param>
|
||||
/// <param name="basePath">Base filename and path to use for checking</param>
|
||||
/// <param name="drive">Drive representing the disc to get information from</param>
|
||||
public abstract void GenerateSubmissionInfo(SubmissionInfo submissionInfo, string basePath, Drive drive);
|
||||
/// <param name="includeArtifacts">True to include output files as encoded artifacts, false otherwise</param>
|
||||
public abstract void GenerateSubmissionInfo(SubmissionInfo submissionInfo, string basePath, Drive drive, bool includeArtifacts);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -601,7 +601,7 @@ namespace MPF.Data
|
||||
};
|
||||
|
||||
// Get specific tool output handling
|
||||
Parameters.GenerateSubmissionInfo(info, combinedBase, this.Drive);
|
||||
Parameters.GenerateSubmissionInfo(info, combinedBase, this.Drive, Options.OutputSubmissionJSON);
|
||||
|
||||
// Get a list of matching IDs for each line in the DAT
|
||||
if (!string.IsNullOrEmpty(info.TracksAndWriteOffsets.ClrMameProData) && Options.HasRedumpLogin)
|
||||
|
||||
@@ -354,7 +354,7 @@ namespace MPF.DiscImageCreator
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, Drive drive)
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, Drive drive, bool includeArtifacts)
|
||||
{
|
||||
string outputDirectory = Path.GetDirectoryName(basePath);
|
||||
|
||||
@@ -708,53 +708,56 @@ namespace MPF.DiscImageCreator
|
||||
break;
|
||||
}
|
||||
|
||||
// Fill in any artifacts that exist, Base64-encoded
|
||||
//if (File.Exists(basePath + ".c2"))
|
||||
// info.Artifacts["c2"] = Convert.ToBase64String(File.ReadAllBytes(basePath + ".c2"));
|
||||
if (File.Exists(basePath + "_c2Error.txt"))
|
||||
info.Artifacts["c2Error"] = GetBase64(GetFullFile(basePath + "_c2Error.txt"));
|
||||
if (File.Exists(basePath + ".ccd"))
|
||||
info.Artifacts["ccd"] = GetBase64(GetFullFile(basePath + ".ccd"));
|
||||
if (File.Exists(basePath + "_cmd.txt")) // TODO: Figure out how to read in the timestamp-named file
|
||||
info.Artifacts["cmd"] = GetBase64(GetFullFile(basePath + "_cmd.txt"));
|
||||
if (File.Exists(basePath + ".cue"))
|
||||
info.Artifacts["cue"] = GetBase64(GetFullFile(basePath + ".cue"));
|
||||
if (File.Exists(basePath + ".dat"))
|
||||
info.Artifacts["dat"] = GetBase64(GetFullFile(basePath + ".dat"));
|
||||
if (File.Exists(basePath + "_disc.txt"))
|
||||
info.Artifacts["disc"] = GetBase64(GetFullFile(basePath + "_disc.txt"));
|
||||
//if (File.Exists(Path.Combine(outputDirectory, "DMI.bin")))
|
||||
// info.Artifacts["dmi"] = Convert.ToBase64String(File.ReadAllBytes(Path.Combine(outputDirectory, "DMI.bin")));
|
||||
if (File.Exists(basePath + "_drive.txt"))
|
||||
info.Artifacts["drive"] = GetBase64(GetFullFile(basePath + "_drive.txt"));
|
||||
if (File.Exists(basePath + "_img.cue"))
|
||||
info.Artifacts["img_cue"] = GetBase64(GetFullFile(basePath + "_img.cue"));
|
||||
if (File.Exists(basePath + ".img_EdcEcc.txt"))
|
||||
info.Artifacts["img_EdcEcc"] = GetBase64(GetFullFile(basePath + ".img_EdcEcc.txt"));
|
||||
if (File.Exists(basePath + ".img_EccEdc.txt"))
|
||||
info.Artifacts["img_EdcEcc"] = GetBase64(GetFullFile(basePath + ".img_EccEdc.txt"));
|
||||
if (File.Exists(basePath + "_mainError.txt"))
|
||||
info.Artifacts["mainError"] = GetBase64(GetFullFile(basePath + "_mainError.txt"));
|
||||
if (File.Exists(basePath + "_mainInfo.txt"))
|
||||
info.Artifacts["mainInfo"] = GetBase64(GetFullFile(basePath + "_mainInfo.txt"));
|
||||
//if (File.Exists(Path.Combine(outputDirectory, "PFI.bin")))
|
||||
// info.Artifacts["pfi"] = Convert.ToBase64String(File.ReadAllBytes(Path.Combine(outputDirectory, "PFI.bin")));
|
||||
//if (File.Exists(Path.Combine(outputDirectory, "SS.bin")))
|
||||
// info.Artifacts["ss"] = Convert.ToBase64String(File.ReadAllBytes(Path.Combine(outputDirectory, "SS.bin")));
|
||||
if (File.Exists(basePath + ".sub"))
|
||||
info.Artifacts["sub"] = Convert.ToBase64String(File.ReadAllBytes(basePath + ".sub"));
|
||||
if (File.Exists(basePath + "_subError.txt"))
|
||||
info.Artifacts["subError"] = GetBase64(GetFullFile(basePath + "_subError.txt"));
|
||||
if (File.Exists(basePath + "_subInfo.txt"))
|
||||
info.Artifacts["subInfo"] = GetBase64(GetFullFile(basePath + "_subInfo.txt"));
|
||||
if (File.Exists(basePath + "_subIntention.txt"))
|
||||
info.Artifacts["subIntention"] = GetBase64(GetFullFile(basePath + "_subIntention.txt"));
|
||||
//if (File.Exists(basePath + "_sub.txt"))
|
||||
// info.Artifacts["subReadable"] = GetBase64(GetFullFile(basePath + "_sub.txt"));
|
||||
//if (File.Exists(basePath + "_subReadable.txt"))
|
||||
// info.Artifacts["subReadable"] = GetBase64(GetFullFile(basePath + "_subReadable.txt"));
|
||||
if (File.Exists(basePath + "_volDesc.txt"))
|
||||
info.Artifacts["volDesc"] = GetBase64(GetFullFile(basePath + "_volDesc.txt"));
|
||||
// Fill in any artifacts that exist, Base64-encoded, if we need to
|
||||
if (includeArtifacts)
|
||||
{
|
||||
//if (File.Exists(basePath + ".c2"))
|
||||
// info.Artifacts["c2"] = Convert.ToBase64String(File.ReadAllBytes(basePath + ".c2"));
|
||||
if (File.Exists(basePath + "_c2Error.txt"))
|
||||
info.Artifacts["c2Error"] = GetBase64(GetFullFile(basePath + "_c2Error.txt"));
|
||||
if (File.Exists(basePath + ".ccd"))
|
||||
info.Artifacts["ccd"] = GetBase64(GetFullFile(basePath + ".ccd"));
|
||||
if (File.Exists(basePath + "_cmd.txt")) // TODO: Figure out how to read in the timestamp-named file
|
||||
info.Artifacts["cmd"] = GetBase64(GetFullFile(basePath + "_cmd.txt"));
|
||||
if (File.Exists(basePath + ".cue"))
|
||||
info.Artifacts["cue"] = GetBase64(GetFullFile(basePath + ".cue"));
|
||||
if (File.Exists(basePath + ".dat"))
|
||||
info.Artifacts["dat"] = GetBase64(GetFullFile(basePath + ".dat"));
|
||||
if (File.Exists(basePath + "_disc.txt"))
|
||||
info.Artifacts["disc"] = GetBase64(GetFullFile(basePath + "_disc.txt"));
|
||||
//if (File.Exists(Path.Combine(outputDirectory, "DMI.bin")))
|
||||
// info.Artifacts["dmi"] = Convert.ToBase64String(File.ReadAllBytes(Path.Combine(outputDirectory, "DMI.bin")));
|
||||
if (File.Exists(basePath + "_drive.txt"))
|
||||
info.Artifacts["drive"] = GetBase64(GetFullFile(basePath + "_drive.txt"));
|
||||
if (File.Exists(basePath + "_img.cue"))
|
||||
info.Artifacts["img_cue"] = GetBase64(GetFullFile(basePath + "_img.cue"));
|
||||
if (File.Exists(basePath + ".img_EdcEcc.txt"))
|
||||
info.Artifacts["img_EdcEcc"] = GetBase64(GetFullFile(basePath + ".img_EdcEcc.txt"));
|
||||
if (File.Exists(basePath + ".img_EccEdc.txt"))
|
||||
info.Artifacts["img_EdcEcc"] = GetBase64(GetFullFile(basePath + ".img_EccEdc.txt"));
|
||||
if (File.Exists(basePath + "_mainError.txt"))
|
||||
info.Artifacts["mainError"] = GetBase64(GetFullFile(basePath + "_mainError.txt"));
|
||||
if (File.Exists(basePath + "_mainInfo.txt"))
|
||||
info.Artifacts["mainInfo"] = GetBase64(GetFullFile(basePath + "_mainInfo.txt"));
|
||||
//if (File.Exists(Path.Combine(outputDirectory, "PFI.bin")))
|
||||
// info.Artifacts["pfi"] = Convert.ToBase64String(File.ReadAllBytes(Path.Combine(outputDirectory, "PFI.bin")));
|
||||
//if (File.Exists(Path.Combine(outputDirectory, "SS.bin")))
|
||||
// info.Artifacts["ss"] = Convert.ToBase64String(File.ReadAllBytes(Path.Combine(outputDirectory, "SS.bin")));
|
||||
if (File.Exists(basePath + ".sub"))
|
||||
info.Artifacts["sub"] = Convert.ToBase64String(File.ReadAllBytes(basePath + ".sub"));
|
||||
if (File.Exists(basePath + "_subError.txt"))
|
||||
info.Artifacts["subError"] = GetBase64(GetFullFile(basePath + "_subError.txt"));
|
||||
if (File.Exists(basePath + "_subInfo.txt"))
|
||||
info.Artifacts["subInfo"] = GetBase64(GetFullFile(basePath + "_subInfo.txt"));
|
||||
if (File.Exists(basePath + "_subIntention.txt"))
|
||||
info.Artifacts["subIntention"] = GetBase64(GetFullFile(basePath + "_subIntention.txt"));
|
||||
//if (File.Exists(basePath + "_sub.txt"))
|
||||
// info.Artifacts["subReadable"] = GetBase64(GetFullFile(basePath + "_sub.txt"));
|
||||
//if (File.Exists(basePath + "_subReadable.txt"))
|
||||
// info.Artifacts["subReadable"] = GetBase64(GetFullFile(basePath + "_subReadable.txt"));
|
||||
if (File.Exists(basePath + "_volDesc.txt"))
|
||||
info.Artifacts["volDesc"] = GetBase64(GetFullFile(basePath + "_volDesc.txt"));
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace MPF.UmdImageCreator
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, Drive drive)
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, Drive drive, bool includeArtifacts)
|
||||
{
|
||||
// Extract info based generically on MediaType
|
||||
switch (this.Type)
|
||||
@@ -86,15 +86,18 @@ namespace MPF.UmdImageCreator
|
||||
break;
|
||||
}
|
||||
|
||||
// Fill in any artifacts that exist, Base64-encoded
|
||||
if (File.Exists(basePath + "_disc.txt"))
|
||||
info.Artifacts["disc"] = GetBase64(GetFullFile(basePath + "_disc.txt"));
|
||||
if (File.Exists(basePath + "_mainError.txt"))
|
||||
info.Artifacts["mainError"] = GetBase64(GetFullFile(basePath + "_mainError.txt"));
|
||||
if (File.Exists(basePath + "_mainInfo.txt"))
|
||||
info.Artifacts["mainInfo"] = GetBase64(GetFullFile(basePath + "_mainInfo.txt"));
|
||||
if (File.Exists(basePath + "_volDesc.txt"))
|
||||
info.Artifacts["volDesc"] = GetBase64(GetFullFile(basePath + "_volDesc.txt"));
|
||||
// Fill in any artifacts that exist, Base64-encoded, if we need to
|
||||
if (includeArtifacts)
|
||||
{
|
||||
if (File.Exists(basePath + "_disc.txt"))
|
||||
info.Artifacts["disc"] = GetBase64(GetFullFile(basePath + "_disc.txt"));
|
||||
if (File.Exists(basePath + "_mainError.txt"))
|
||||
info.Artifacts["mainError"] = GetBase64(GetFullFile(basePath + "_mainError.txt"));
|
||||
if (File.Exists(basePath + "_mainInfo.txt"))
|
||||
info.Artifacts["mainInfo"] = GetBase64(GetFullFile(basePath + "_mainInfo.txt"));
|
||||
if (File.Exists(basePath + "_volDesc.txt"))
|
||||
info.Artifacts["volDesc"] = GetBase64(GetFullFile(basePath + "_volDesc.txt"));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user