mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
CHDs not in folders of parent
This commit is contained in:
@@ -1754,29 +1754,17 @@ namespace SabreTools.Library.DatFiles
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the merge tag exists but the parent doesn't contain it, add
|
// If the merge tag exists but the parent doesn't contain it, add to parent
|
||||||
else if (disk.MergeTag != null && !datFile[parent].Select(i => i.Name).Contains(disk.MergeTag))
|
else if (disk.MergeTag != null && !datFile[parent].Select(i => i.Name).Contains(disk.MergeTag))
|
||||||
{
|
{
|
||||||
// Rename the child so it's in a subfolder
|
|
||||||
item.Name = $"{item.MachineName}\\{item.Name}";
|
|
||||||
|
|
||||||
// Update the machine to be the new parent
|
|
||||||
item.CopyMachineInformation(copyFrom);
|
item.CopyMachineInformation(copyFrom);
|
||||||
|
|
||||||
// Add the rom to the parent set
|
|
||||||
datFile.Add(parent, item);
|
datFile.Add(parent, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the parent doesn't already contain this item, add it
|
// If the parent doesn't already contain this item, add to parent
|
||||||
else if (!datFile[parent].Contains(item))
|
else if (!datFile[parent].Contains(item))
|
||||||
{
|
{
|
||||||
// Rename the child so it's in a subfolder
|
|
||||||
item.Name = $"{item.MachineName}\\{item.Name}";
|
|
||||||
|
|
||||||
// Update the machine to be the new parent
|
|
||||||
item.CopyMachineInformation(copyFrom);
|
item.CopyMachineInformation(copyFrom);
|
||||||
|
|
||||||
// Add the rom to the parent set
|
|
||||||
datFile.Add(parent, item);
|
datFile.Add(parent, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1792,43 +1780,28 @@ namespace SabreTools.Library.DatFiles
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the merge tag exists but the parent doesn't contain it, add
|
// If the merge tag exists but the parent doesn't contain it, add to subfolder of parent
|
||||||
else if (rom.MergeTag != null && !datFile[parent].Select(i => i.Name).Contains(rom.MergeTag))
|
else if (rom.MergeTag != null && !datFile[parent].Select(i => i.Name).Contains(rom.MergeTag))
|
||||||
{
|
{
|
||||||
// Rename the child so it's in a subfolder
|
|
||||||
item.Name = $"{item.MachineName}\\{item.Name}";
|
item.Name = $"{item.MachineName}\\{item.Name}";
|
||||||
|
|
||||||
// Update the machine to be the new parent
|
|
||||||
item.CopyMachineInformation(copyFrom);
|
item.CopyMachineInformation(copyFrom);
|
||||||
|
|
||||||
// Add the rom to the parent set
|
|
||||||
datFile.Add(parent, item);
|
datFile.Add(parent, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the parent doesn't already contain this item, add it
|
// If the parent doesn't already contain this item, add to subfolder of parent
|
||||||
else if (!datFile[parent].Contains(item))
|
else if (!datFile[parent].Contains(item))
|
||||||
{
|
{
|
||||||
// Rename the child so it's in a subfolder
|
|
||||||
item.Name = $"{item.MachineName}\\{item.Name}";
|
item.Name = $"{item.MachineName}\\{item.Name}";
|
||||||
|
|
||||||
// Update the machine to be the new parent
|
|
||||||
item.CopyMachineInformation(copyFrom);
|
item.CopyMachineInformation(copyFrom);
|
||||||
|
|
||||||
// Add the rom to the parent set
|
|
||||||
datFile.Add(parent, item);
|
datFile.Add(parent, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// All other that would be missing
|
// All other that would be missing to subfolder of parent
|
||||||
else if (!datFile[parent].Contains(item))
|
else if (!datFile[parent].Contains(item))
|
||||||
{
|
{
|
||||||
// Rename the child so it's in a subfolder
|
|
||||||
item.Name = $"{item.MachineName}\\{item.Name}";
|
item.Name = $"{item.MachineName}\\{item.Name}";
|
||||||
|
|
||||||
// Update the machine to be the new parent
|
|
||||||
item.CopyMachineInformation(copyFrom);
|
item.CopyMachineInformation(copyFrom);
|
||||||
|
|
||||||
// Add the rom to the parent set
|
|
||||||
datFile.Add(parent, item);
|
datFile.Add(parent, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user