diff --git a/Modules/ZipPipeline.ps1 b/Modules/ZipPipeline.ps1 index 7f96dc1..4269f20 100644 --- a/Modules/ZipPipeline.ps1 +++ b/Modules/ZipPipeline.ps1 @@ -300,12 +300,6 @@ function Invoke-ZipOnlyPipeline { } return $totals } - - $zoCompleteMsg = "Zip-only processing complete: " + $totals.ZippedSuccess + " zipped, " + $totals.ZippedFail + " failed." - if ($totals.ForceStoppedCount -gt 0) { - $zoCompleteMsg += (" " + $totals.ForceStoppedCount + " job(s) force-stopped on abort.") - } - Write-Log $zoCompleteMsg -Level Summary } finally { Complete-CcrAllSeriesProgressIfEnabled } diff --git a/_Harness/ZipPipeline.Harness.ps1 b/_Harness/ZipPipeline.Harness.ps1 index 3047252..2e2642c 100644 --- a/_Harness/ZipPipeline.Harness.ps1 +++ b/_Harness/ZipPipeline.Harness.ps1 @@ -242,6 +242,20 @@ $abortedLineB2 = @(Get-Content -LiteralPath $script:logWarnFile | Where-Object { Test-Assert ($abortedLineB2.Count -ge 1) "the log reports the run was aborted before finding anything, not the generic 'no qualifying leaf directories found' message an empty library gets" Write-Host "" +# ============================================================================== +# Scenario B3: the pipeline prints no totals of its own - the end-of-run +# summary reports the same counts right after it. +# ============================================================================== +Write-Host "=== Scenario B3: no totals line of its own ===" -ForegroundColor Cyan +$rootB3 = New-Dir "scenario-b3" +New-FileIn -DirPath (New-Dir "scenario-b3\Chapter 1") -Name "page1.jpg" | Out-Null +$script:totalsB3 = $null +$outputB3 = @(& { $script:totalsB3 = Invoke-ZipOnlyPipeline -Path $rootB3 -MaxParallel 1 -PermanentDelete $true } 6>&1 | ForEach-Object { "$_" }) +Test-Assert ($script:totalsB3.ZippedSuccess -eq 1) "sanity check: the chapter was zipped" +Test-Assert (@($outputB3 | Where-Object { $_ -like "*ZIP OK*" }).Count -eq 1) "sanity check: the per-chapter line is still logged" +Test-Assert (@($outputB3 | Where-Object { $_ -like "*``[Summary``]*" }).Count -eq 0) ("no Summary-level line (got: " + (@($outputB3 | Where-Object { $_ -like "*``[Summary``]*" }) -join " / ") + ")") +Write-Host "" + # ============================================================================== # Scenario C: -DeleteFolders $false - zips are created but source # folders are left alone. diff --git a/module-descriptions.md b/module-descriptions.md index 13101ec..94db101 100644 --- a/module-descriptions.md +++ b/module-descriptions.md @@ -543,7 +543,7 @@ Zip Folders (menu option 4): finds every chapter folder under a library path, zi - The source-folder delete is outside the zip try/catch on purpose. If it were inside, a problem in the delete or its logging would be treated as a zip failure and would delete the archive that was just verified. - The worker only sets two script-level values in its runspace (`$script:workerConsoleQueue` for logging through the console queue, and `$script:PermanentDelete`), and loads the `Microsoft.VisualBasic` and `System.IO.Compression.FileSystem` assemblies itself. - Series names for Clean Console Output are derived from the folder's path relative to the scan root: the first path segment, or deeper if that segment is a category folder (checked with `Test-SeriesCategoryFolder`, cached per root). The first time a series appears, its chapter count is found with a separate `Get-ZippableLeafDirs` scan so the progress bar has a total. All of this is wrapped in a try/catch: a failure there only logs a warning, because it is display bookkeeping and must not stop the zip run. -- If no candidates are found the run logs either "aborted before any leaf directory was found" or "no qualifying leaf directories found", depending on `Aborted`. Otherwise it logs a summary line with zipped/failed counts and any force-stopped jobs. `Complete-AllActiveSeriesProgress` runs in `finally`. +- If no candidates are found the run logs either "aborted before any leaf directory was found" or "no qualifying leaf directories found", depending on `Aborted`. The totals are returned, not logged; the end-of-run summary reports them. `Complete-AllActiveSeriesProgress` runs in `finally`. - Default qualifying extensions cover images (`.jpg .jpeg .png .gif .webp .avif .jxl .bmp .tiff .tif .heic .heif`), video (`.mp4 .mkv .webm .avi .mov .wmv`) and `.cbz .cbr .epub .pdf`. - There is no check that the layout is a proper Series/Chapter tree; any leaf folder with qualifying files gets zipped.