diff --git a/RombaSharp/RombaSharp.Help.cs b/RombaSharp/RombaSharp.Help.cs index c4511ef4..1838123a 100644 --- a/RombaSharp/RombaSharp.Help.cs +++ b/RombaSharp/RombaSharp.Help.cs @@ -98,7 +98,7 @@ namespace RombaSharp return new Feature( "include-7zips", "-include-7zips", - "flag value == 1 means: add 7zip files themselves into the depot in addition to their contents, flag value > 1 means add 7zip files themselves but don't add content", + "flag value == 0 means: add 7zip files themselves into the depot in addition to their contents, flag value == 2 means add 7zip files themselves but don't add content", FeatureType.Int32); } } @@ -109,7 +109,7 @@ namespace RombaSharp return new Feature( "include-gzips", "-include-gzips", - "flag value == 1 means: add gzip files themselves into the depot in addition to their contents, flag value > 1 means add gzip files themselves but don't add content", + "flag value == 0 means: add gzip files themselves into the depot in addition to their contents, flag value == 2 means add gzip files themselves but don't add content", FeatureType.Int32); } } @@ -120,7 +120,7 @@ namespace RombaSharp return new Feature( "include-zips", "-include-zips", - "flag value == 1 means: add zip files themselves into the depot in addition to their contents, flag value > 1 means add zip files themselves but don't add content", + "flag value == 0 means: add zip files themselves into the depot in addition to their contents, flag value == 2 means add zip files themselves but don't add content", FeatureType.Int32); } } diff --git a/RombaSharp/RombaSharp.Inits.cs b/RombaSharp/RombaSharp.Inits.cs index c4c05ec8..7e8a5938 100644 --- a/RombaSharp/RombaSharp.Inits.cs +++ b/RombaSharp/RombaSharp.Inits.cs @@ -28,14 +28,13 @@ namespace RombaSharp /// List of input folders to use /// True if only files in the database and don't exist are added, false otherwise /// Resume a previously interrupted operation from the specified path - /// flag value == 1 means: add Zip files themselves into the depot in addition to their contents, flag value > 1 means add Zip files themselves but don't add content + /// flag value == 0 means: add Zip files themselves into the depot in addition to their contents, flag value == 2 means add Zip files themselves but don't add content /// How many workers to launch for the job, default from config - /// flag value == 1 means: add GZip files themselves into the depot in addition to their contents, flag value > 1 means add GZip files themselves but don't add content - /// flag value == 1 means: add 7Zip files themselves into the depot in addition to their contents, flag value > 1 means add 7Zip files themselves but don't add content + /// flag value == 0 means: add GZip files themselves into the depot in addition to their contents, flag value == 2 means add GZip files themselves but don't add content + /// flag value == 0 means: add 7Zip files themselves into the depot in addition to their contents, flag value == 2 means add 7Zip files themselves but don't add content /// True to skip the initial scan of the files to determine amount of work, false otherwise /// True to use go zip implementation instead of zlib, false otherwise /// True to archive into depot but do not touch DB index and ignore only-needed flag, false otherwise - /// TODO: Verify implementation private static void InitArchive( List inputs, bool onlyNeeded, @@ -45,7 +44,7 @@ namespace RombaSharp int includeGZips, int include7Zips, bool skipInitialScan, - bool useGolangZip, + bool useGolangZip, // Obsolete bool noDb) { // First we want to get just all directories from the inputs @@ -87,7 +86,7 @@ namespace RombaSharp foreach (Rom rom in datItems) { // If we care about if the file exists, check the databse first - if (onlyNeeded) + if (onlyNeeded && !noDb) { string query = "SELECT * FROM crcsha1 JOIN md5sha1 ON crcsha1.sha1=md5sha1.sha1" + " WHERE crcsha1.crc=\"" + rom.CRC + "\"" @@ -129,25 +128,28 @@ namespace RombaSharp else { // Add to the queries - if (!String.IsNullOrWhiteSpace(rom.CRC)) + if (!noDb) { - crcquery += " (\"" + rom.CRC + "\"),"; - } - if (!String.IsNullOrWhiteSpace(rom.MD5)) - { - md5query += " (\"" + rom.MD5 + "\"),"; - } - if (!String.IsNullOrWhiteSpace(rom.SHA1)) - { - sha1query += " (\"" + rom.SHA1 + "\", \"" + _depots.Keys.ToList()[0] + "\"),"; - if (!String.IsNullOrWhiteSpace(rom.CRC)) { - crcsha1query += " (\"" + rom.CRC + "\", \"" + rom.SHA1 + "\"),"; + crcquery += " (\"" + rom.CRC + "\"),"; } if (!String.IsNullOrWhiteSpace(rom.MD5)) { - md5sha1query += " (\"" + rom.MD5 + "\", \"" + rom.SHA1 + "\"),"; + md5query += " (\"" + rom.MD5 + "\"),"; + } + if (!String.IsNullOrWhiteSpace(rom.SHA1)) + { + sha1query += " (\"" + rom.SHA1 + "\", \"" + _depots.Keys.ToList()[0] + "\"),"; + + if (!String.IsNullOrWhiteSpace(rom.CRC)) + { + crcsha1query += " (\"" + rom.CRC + "\", \"" + rom.SHA1 + "\"),"; + } + if (!String.IsNullOrWhiteSpace(rom.MD5)) + { + md5sha1query += " (\"" + rom.MD5 + "\", \"" + rom.SHA1 + "\"),"; + } } } @@ -190,7 +192,7 @@ namespace RombaSharp } // Create the sorting object to use and rebuild the needed files - ArchiveScanLevel asl = Utilities.GetArchiveScanLevelFromNumbers(2, 2, 2, 2); + ArchiveScanLevel asl = Utilities.GetArchiveScanLevelFromNumbers(include7Zips, includeGZips, 2, includeZips); need.RebuildGeneric(onlyDirs, _depots.Keys.ToList()[0], false /*quickScan*/, false /*date*/, false /*delete*/, false /*inverse*/, OutputFormat.TorrentGzip, true /*romba*/, asl, false /*updateDat*/, null /*headerToCheckAgainst*/, true /* chdsAsFiles */); diff --git a/RombaSharp/RombaSharp.cs b/RombaSharp/RombaSharp.cs index 738f5a97..87f5144f 100644 --- a/RombaSharp/RombaSharp.cs +++ b/RombaSharp/RombaSharp.cs @@ -114,9 +114,9 @@ namespace RombaSharp outdat = "", resume = "", source = ""; - int include7Zips = 0, - includeGZips = 0, - includeZips = 0, + int include7Zips = 1, + includeGZips = 1, + includeZips = 1, subworkers = 0, workers = 0; long size = -1;