[DatFile, ArchiveTools] TODO cleanup

This commit is contained in:
Matt Nadareski
2017-03-16 23:55:08 -07:00
parent 850821fb85
commit 2d5d9b74e7
6 changed files with 14 additions and 19 deletions

View File

@@ -581,9 +581,6 @@ namespace SabreTools.Helper.Dats
/// </summary> /// </summary>
/// <param name="infiles">List of File objects representing the roms to be merged</param> /// <param name="infiles">List of File objects representing the roms to be merged</param>
/// <returns>A List of RomData objects representing the renamed roms</returns> /// <returns>A List of RomData objects representing the renamed roms</returns>
/// <remarks>
/// TODO: Eventually, we want this to use the CRC/MD5/SHA-1 of relavent items instead of just _1
/// </remarks>
public static List<DatItem> ResolveNames(List<DatItem> infiles) public static List<DatItem> ResolveNames(List<DatItem> infiles)
{ {
// Create the output list // Create the output list
@@ -623,16 +620,24 @@ namespace SabreTools.Helper.Dats
if (datItem.Type == ItemType.Disk) if (datItem.Type == ItemType.Disk)
{ {
Disk disk = (Disk)datItem; Disk disk = (Disk)datItem;
disk.Name += "_" + (!String.IsNullOrEmpty(disk.MD5) ? disk.MD5 : disk.SHA1); disk.Name += "_" + (!String.IsNullOrEmpty(disk.MD5)
? disk.MD5
: !String.IsNullOrEmpty(disk.SHA1)
? disk.SHA1
: "1");
datItem = disk; datItem = disk;
lastrenamed = lastrenamed ?? datItem.Name; lastrenamed = lastrenamed ?? datItem.Name;
} }
else if (datItem.Type == ItemType.Rom) else if (datItem.Type == ItemType.Rom)
{ {
Rom rom = (Rom)datItem; Rom rom = (Rom)datItem;
rom.Name += "_" + (!String.IsNullOrEmpty(rom.CRC) ? rom.CRC : rom.Name += "_" + (!String.IsNullOrEmpty(rom.CRC)
!String.IsNullOrEmpty(rom.MD5) ? rom.MD5 : ? rom.CRC
!String.IsNullOrEmpty(rom.SHA1) ? rom.SHA1 : "(alt)"); : !String.IsNullOrEmpty(rom.MD5)
? rom.MD5
: !String.IsNullOrEmpty(rom.SHA1)
? rom.SHA1
: "1");
datItem = rom; datItem = rom;
lastrenamed = lastrenamed ?? datItem.Name; lastrenamed = lastrenamed ?? datItem.Name;
} }

View File

@@ -38,9 +38,6 @@ namespace SabreTools.Helper.Dats
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param> /// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
/// <param name="single">True if all games should be replaced by '!', false otherwise</param> /// <param name="single">True if all games should be replaced by '!', false otherwise</param>
/// <param name="root">String representing root directory to compare against for length calculation</param> /// <param name="root">String representing root directory to compare against for length calculation</param>
/// <remarks>
/// TODO: Folder-wise output for update (similar to level-split)
/// </remarks>
public void DetermineUpdateType(List<string> inputPaths, string outDir, bool merge, DiffMode diff, bool inplace, bool skip, public void DetermineUpdateType(List<string> inputPaths, string outDir, bool merge, DiffMode diff, bool inplace, bool skip,
bool bare, bool clean, bool descAsName, Filter filter, SplitType splitType, bool trim, bool single, string root) bool bare, bool clean, bool descAsName, Filter filter, SplitType splitType, bool trim, bool single, string root)
{ {

View File

@@ -1271,7 +1271,7 @@ namespace SabreTools.Helper.Dats
/// <param name="descAsName">True if SL XML names should be kept, false otherwise (default)</param> /// <param name="descAsName">True if SL XML names should be kept, false otherwise (default)</param>
/// <remrks> /// <remrks>
/// TODO: Software Lists - sharedfeat tag (read-in, write-out) /// TODO: Software Lists - sharedfeat tag (read-in, write-out)
/// TODO: If updating softlists, is it possible to update cloneof/romof/sampleof tags as well? /// TODO: If replacing name with description, is it possible to update cloneof/romof/sampleof tags as well?
/// </remrks> /// </remrks>
private void ParseGenericXML( private void ParseGenericXML(
// Standard Dat parsing // Standard Dat parsing

View File

@@ -19,9 +19,6 @@ using Stream = System.IO.Stream;
namespace SabreTools.Helper.Dats namespace SabreTools.Helper.Dats
{ {
/*
* TODO: Delete flags - Remove files from archive if only some are used (rebuild to TZip)
*/
public partial class DatFile public partial class DatFile
{ {
#region Rebuilding and Verifying [MODULAR DONE, FOR NOW] #region Rebuilding and Verifying [MODULAR DONE, FOR NOW]

View File

@@ -20,11 +20,7 @@ namespace SabreTools.Helper.Dats
/* /*
* TODO: Make output standard width (HTML, without making the entire thing a table) * TODO: Make output standard width (HTML, without making the entire thing a table)
* TODO: Multithreading? Either StringBuilder or locking * TODO: Multithreading? Either StringBuilder or locking
* TODO: Deduped size?
* TODO: Sort by size?
* TODO: Fix alignment for stats output (text) * TODO: Fix alignment for stats output (text)
* TODO: Add compressed size (10-50% of total file size based on averages)
* TODO: Add "gain" based on compressed compared to total size
*/ */
public partial class DatFile public partial class DatFile
{ {

View File

@@ -2482,7 +2482,7 @@ namespace SabreTools.Helper.Tools
File.Move(tempFile, archiveFileName); File.Move(tempFile, archiveFileName);
// Now make the file TXZ // Now make the file TXZ
// TODO: Add ACTUAL T7Z compatible code // TODO: Add ACTUAL TXZ compatible code (based on T7z)
BinaryWriter bw = new BinaryWriter(FileTools.TryOpenReadWrite(archiveFileName)); BinaryWriter bw = new BinaryWriter(FileTools.TryOpenReadWrite(archiveFileName));
bw.Seek(0, SeekOrigin.Begin); bw.Seek(0, SeekOrigin.Begin);