Skip to content

Fix Zip Folders' reversed series order and empty log files - #5

Merged
HalRiveria merged 3 commits into
mainfrom
fix/zip-order-and-empty-logs
Nov 30, 2026
Merged

HalRiveria merged 3 commits into
mainfrom
fix/zip-order-and-empty-logs

Conversation

@HalRiveria-Bot

Copy link
Copy Markdown
Collaborator

Two fixes.

Zip Folders worked through series in reverse. The folder scan pushed every subfolder onto a stack and popped them last-in, first-out, so series came out Z to A (chapters inside a series were in order). It now keeps one open enumerator per folder level and walks each subfolder to its end before the next one, the same way the series scan for the other modes does. Series, volumes and chapters come out in the order the file system lists them, which is alphabetical on NTFS.

The Errors and Warnings logs were created on every run, even a clean one. The run header was written to both files up front. It's now written together with the run's first line in that file, so a run with nothing to report creates no file and leaves an existing one alone. If that first write fails, the header goes in with the next line that does get written.

Tests:

  • New order test (series, volumes, chapters, and a one-shot next to a series): failed before, passes now.
  • New log tests (clean run, warnings-only run, a warning between runs, existing file untouched, locked file): eight assertions failed before, all pass now. The locked-file one is new coverage and passed before too.
  • The lint allow-list gets one entry: the log write helper reads the pending-header table, on the main thread only.
  • All harnesses pass on Windows PowerShell 5.1. The two changed modules' harnesses also pass on PowerShell 7.
  • Ran the real Zip Folders pipeline on a small copied library: zips were made in A to C order, a clean run left no log files, and a run with warnings created only the Warnings log.

Not changed: volumes inside a series are still listed in reverse in the other three modes, which use a separate scan.

🤖 Generated with Claude Code

HalRiveria and others added 3 commits November 30, 2026 15:13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t in them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HalRiveria
HalRiveria merged commit ace9d6c into main Nov 30, 2026
1 check passed
@HalRiveria
HalRiveria deleted the fix/zip-order-and-empty-logs branch November 30, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants