remove debug

This commit is contained in:
Nathan
2025-12-19 15:36:01 -07:00
parent 7896059a86
commit 1bafe5fe85
2 changed files with 289 additions and 11 deletions

View File

@@ -169,19 +169,13 @@ function Process-DuplicateGroup {
# If StripPrefix is enabled, always strip prefix from the filename
if ($StripPrefix) {
Write-Host " [DEBUG] StripPrefix enabled for group with $($Files.Count) file(s)" -ForegroundColor Magenta
# Always try to strip prefix - if file has a prefix, it will be removed
$strippedName = Get-FileNameWithoutPrefix -FileName $firstFile.Name -ValidPrefixes $ValidPrefixes
Write-Host " [DEBUG] Original: '$($firstFile.Name)' -> Stripped: '$strippedName'" -ForegroundColor Gray
# Use stripped name if it's different from original (prefix was removed)
# Otherwise keep original (file had no prefix to strip)
if ($strippedName -ne $firstFile.Name) {
$fileName = $strippedName
Write-Host " [DEBUG] Using stripped name: '$fileName'" -ForegroundColor Green
} else {
Write-Host " [DEBUG] No prefix found, keeping original: '$fileName'" -ForegroundColor Yellow
}
# If we have multiple files with same checksum, try to find common suffix
@@ -194,17 +188,12 @@ function Process-DuplicateGroup {
$allSuffixes += $suffix
}
Write-Host " [DEBUG] All suffixes: $($allSuffixes -join ', ')" -ForegroundColor Gray
# If all files strip to the same suffix, use that
$uniqueSuffixes = @($allSuffixes | Select-Object -Unique)
if ($uniqueSuffixes.Count -eq 1 -and $uniqueSuffixes[0] -ne $firstFile.Name) {
$fileName = [string]$uniqueSuffixes[0]
Write-Host " [DEBUG] All files share common suffix, using: '$fileName'" -ForegroundColor Green
}
}
Write-Host " [DEBUG] Final filename: '$fileName'" -ForegroundColor Cyan
}
# Ensure fileName is never null or empty