Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Modules/ZipPipeline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
14 changes: 14 additions & 0 deletions _Harness/ZipPipeline.Harness.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion module-descriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading