diff --git a/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs b/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs
index 59df99e4..89ed0385 100644
--- a/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs
+++ b/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs
@@ -458,9 +458,6 @@ namespace SabreTools.Helper.Dats
/// True if the input file is an archive, false otherwise
/// Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise
/// True if the file was able to be rebuilt, false otherwise
- ///
- /// TODO: If going from a TGZ file to a TGZ file, don't extract, just copy
- ///
private bool RebuildIndividualFile(Rom rom, string file, string outDir, string tempDir, bool date,
bool inverse, OutputFormat outputFormat, bool romba, bool updateDat, bool isZip, string headerToCheckAgainst)
{
@@ -482,6 +479,32 @@ namespace SabreTools.Helper.Dats
return rebuilt;
}
+ // If we have a very specifc TGZ->TGZ case, just copy it accordingly
+ if (isZip && ArchiveTools.GetTorrentGZFileInfo(file) != null && outputFormat == OutputFormat.TorrentGzip)
+ {
+ // Get the proper output path
+ if (romba)
+ {
+ outDir = Path.Combine(outDir, Style.GetRombaPath(rom.SHA1));
+ }
+
+ // Make sure the output folder is created
+ Directory.CreateDirectory(Path.GetDirectoryName(outDir));
+
+ // Now copy the file over
+ try
+ {
+ File.Copy(file, outDir);
+ rebuilt &= true;
+ }
+ catch
+ {
+ rebuilt = false;
+ }
+
+ return rebuilt;
+ }
+
// If we have an archive input, get the real name of the file to use
// TODO: Remove the need to extract the file first; reimplement ArchiveToArchive?
if (isZip)
@@ -555,6 +578,32 @@ namespace SabreTools.Helper.Dats
{
string machinename = null;
+ // If we have a very specifc TGZ->TGZ case, just copy it accordingly
+ if (isZip && ArchiveTools.GetTorrentGZFileInfo(file) != null && outputFormat == OutputFormat.TorrentGzip)
+ {
+ // Get the proper output path
+ if (romba)
+ {
+ outDir = Path.Combine(outDir, Style.GetRombaPath(rom.SHA1));
+ }
+
+ // Make sure the output folder is created
+ Directory.CreateDirectory(Path.GetDirectoryName(outDir));
+
+ // Now copy the file over
+ try
+ {
+ File.Copy(file, outDir);
+ rebuilt &= true;
+ }
+ catch
+ {
+ rebuilt = false;
+ }
+
+ return rebuilt;
+ }
+
// If we have an archive input, get the real name of the file to use
if (isZip)
{