1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-08 09:09:22 +00:00

feat: add game media cleanup (replays, screenshots, recordings)

- Add Clear-GameMediaFiles function to clean old game media (>90d by default)
- Supports NVIDIA ShadowPlay/Highlights, AMD ReLive, Xbox Game Bar
- Supports Steam screenshots, OBS recordings, Medal.tv, Overwolf/Outplayed
- Includes game-specific replays (Fortnite, LoL, Valorant, Rocket League, etc.)
- New -GameMedia flag for mole clean command
- Uses age-based cleanup to protect recent recordings
This commit is contained in:
Bhadra
2026-01-12 20:23:51 +05:30
parent 8b3def7ffe
commit 3dccf3592f
2 changed files with 259 additions and 8 deletions

View File

@@ -6,6 +6,7 @@
param(
[switch]$DryRun,
[switch]$System,
[switch]$GameMedia,
[switch]$DebugMode,
[switch]$Whitelist,
[switch]$ShowHelp
@@ -51,14 +52,16 @@ function Show-CleanHelp {
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " -DryRun Preview changes without deleting (recommended first run)"
Write-Host " -System Include system-level cleanup (requires admin)"
Write-Host " -GameMedia Clean old game replays, screenshots, recordings (>90d)"
Write-Host " -Whitelist Manage protected paths"
Write-Host " -DebugMode Enable debug logging"
Write-Host " -ShowHelp Show this help message"
Write-Host ""
Write-Host "$esc[33mExamples:$esc[0m"
Write-Host " mole clean -DryRun # Preview what would be cleaned"
Write-Host " mole clean # Run standard cleanup"
Write-Host " mole clean -System # Include system cleanup (as admin)"
Write-Host " mole clean -DryRun # Preview what would be cleaned"
Write-Host " mole clean # Run standard cleanup"
Write-Host " mole clean -GameMedia # Include old game media cleanup"
Write-Host " mole clean -System # Include system cleanup (as admin)"
Write-Host ""
}
@@ -161,7 +164,8 @@ function Show-CleanupSummary {
function Start-Cleanup {
param(
[bool]$IsDryRun,
[bool]$IncludeSystem
[bool]$IncludeSystem,
[bool]$IncludeGameMedia
)
$esc = [char]27
@@ -239,8 +243,13 @@ function Start-Cleanup {
# Developer tools
Invoke-DevToolsCleanup
# Applications cleanup
Invoke-AppCleanup
# Applications cleanup (with optional game media)
if ($IncludeGameMedia) {
Invoke-AppCleanup -IncludeGameMedia -GameMediaDaysOld 90
}
else {
Invoke-AppCleanup
}
# System cleanup (if requested and admin)
if ($IncludeSystem -and (Test-IsAdmin)) {
@@ -291,7 +300,7 @@ function Main {
# Run cleanup
try {
Start-Cleanup -IsDryRun $DryRun -IncludeSystem $System
Start-Cleanup -IsDryRun $DryRun -IncludeSystem $System -IncludeGameMedia $GameMedia
}
finally {
# Cleanup temp files