mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Add Steam filter if specific example exists
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user