From 03cdc8be602973308867bac994dc9a091fddcee0 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 23 Jul 2020 00:08:03 -0700 Subject: [PATCH] One more revert --- SabreTools.Library/DatFiles/Filter.cs | 48 +++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/SabreTools.Library/DatFiles/Filter.cs b/SabreTools.Library/DatFiles/Filter.cs index 0f0feb35..1fad8c2f 100644 --- a/SabreTools.Library/DatFiles/Filter.cs +++ b/SabreTools.Library/DatFiles/Filter.cs @@ -873,6 +873,30 @@ namespace SabreTools.Library.DatFiles try { + // Process description to machine name + if (this.DescriptionAsName) + MachineDescriptionToName(outDat); + + // If we are using tags from the DAT, set the proper input for split type unless overridden + if (useTags && this.InternalSplit == SplitType.None) + this.InternalSplit = outDat.DatHeader.ForceMerging.AsSplitType(); + + // Run internal splitting + ProcessSplitType(outDat, this.InternalSplit); + + // We remove any blanks, if we aren't supposed to have any + if (!outDat.DatHeader.KeepEmptyGames) + { + foreach (string key in outDat.Keys) + { + List items = outDat[key]; + List newitems = items.Where(i => i.ItemType != ItemType.Blank).ToList(); + + outDat.Remove(key); + outDat.AddRange(key, newitems); + } + } + // Loop over every key in the dictionary List keys = datFile.Keys; foreach (string key in keys) @@ -928,30 +952,6 @@ namespace SabreTools.Library.DatFiles outDat.AddRange(key, newitems); } - // Process description to machine name - if (this.DescriptionAsName) - MachineDescriptionToName(outDat); - - // If we are using tags from the DAT, set the proper input for split type unless overridden - if (useTags && this.InternalSplit == SplitType.None) - this.InternalSplit = outDat.DatHeader.ForceMerging.AsSplitType(); - - // Run internal splitting - ProcessSplitType(outDat, this.InternalSplit); - - // We remove any blanks, if we aren't supposed to have any - if (!outDat.DatHeader.KeepEmptyGames) - { - foreach (string key in outDat.Keys) - { - List items = outDat[key]; - List newitems = items.Where(i => i.ItemType != ItemType.Blank).ToList(); - - outDat.Remove(key); - outDat.AddRange(key, newitems); - } - } - // If we are removing scene dates, do that now if (outDat.DatHeader.SceneDateStrip) StripSceneDatesFromItems(outDat);