Add Steam filter if specific example exists

This commit is contained in:
Matt Nadareski
2026-03-18 22:10:52 -04:00
parent 7a4b575051
commit 7fb3f1c62e
4 changed files with 24 additions and 4 deletions

View File

@@ -76,6 +76,7 @@
- Attempt to fix image scanning issues
- Parse and process Steam AppIDs and DepotIDs (Bestest)
- Minor cleanup from missed recommendations
- Add Steam filter if specific example exists
### 3.6.0 (2025-11-28)

View File

@@ -817,6 +817,19 @@ namespace MPF.Frontend.Test.Tools
Assert.Equal("StarForce Keyless", sanitized);
}
[Fact]
public void SanitizeFoundProtections_Steam()
{
List<string> protections =
[
"Steam",
"Steam (.sis/.csm/.csd)",
];
string sanitized = ProtectionTool.SanitizeFoundProtections(protections);
Assert.Equal("Steam (.sis/.csm/.csd)", sanitized);
}
[Fact]
public void SanitizeFoundProtections_Sysiphus()
{

View File

@@ -195,9 +195,8 @@ namespace MPF.Frontend.Tools
if (!File.Exists(sis))
continue;
long sisSize = new FileInfo(sis).Length;
// Arbitrary filesize cap, a disc would need over 100x the normal amount of depots to go over this
long sisSize = new FileInfo(sis).Length;
if (sisSize > 10_000)
continue;
@@ -268,9 +267,8 @@ namespace MPF.Frontend.Tools
if (!File.Exists(sis))
continue;
long sisSize = new FileInfo(sis).Length;
// Arbitrary filesize cap, a disc would need over 100x the normal amount of depots to go over this.
long sisSize = new FileInfo(sis).Length;
if (sisSize > 10_000)
continue;

View File

@@ -651,6 +651,14 @@ namespace MPF.Frontend.Tools
foundProtections.Add("StarForce Keyless");
}
// Steam
if (foundProtections.Exists(p => p == "Steam")
&& foundProtections.Exists(p => p.StartsWith("Steam")
&& p.Length > "Steam".Length))
{
foundProtections = foundProtections.FindAll(p => p != "Steam");
}
// Sysiphus
if (foundProtections.Exists(p => p == "Sysiphus")
&& foundProtections.Exists(p => p.StartsWith("Sysiphus") && p.Length > "Sysiphus".Length))