Skip to content

Fix four dead ends between Quick add and the library (und language, .DS_Store, disk reserve, unverified route) - #111

Open
selbereth wants to merge 1 commit into
logabell:mainfrom
selbereth:fix/setup-dead-ends
Open

selbereth wants to merge 1 commit into
logabell:mainfrom
selbereth:fix/setup-dead-ends

Conversation

@selbereth

Copy link
Copy Markdown

What

Four small fixes for the dead ends described in #110 (and the first one from #109). Each one stopped a first download with a message that named the wrong cause or gave no next step.

# Before After
1 The files use a different language for an M4B whose only language marker is the MP4 stream default und und, zxx, mul and mis are treated like an absent tag. Real languages (e.g. fr against an English book) still conflict.
2 A structural destination folder already contains files when the author folder held only a macOS .DS_Store .DS_Store, ._*, Thumbs.db, desktop.ini, .localized and .directory are ignored in structural ancestors. When a real file blocks publishing, the message names the folder and up to three files.
3 Waiting for free disk space after existing reservations and reserve Waiting for free disk space: 645.0 GiB free after reservations, 1.0 GiB needed, 870.4 GiB kept in reserve (Settings → Download clients → Storage reserve)
4 409 Automatic import approval changed; review this import when a download starts while automatic import is only requested (unverified route) 409 Automatic import is not active for this library folder. Verify its download folder in Settings → Libraries, then turn automatic import on

Change 4 only touches approve_route() (download dispatch). check_policy() and its "approval changed" messages are untouched, so the generation/approver/recovery cases and their tests behave as before.

Not included

Tests

  • New unit tests: undetermined vs real file languages, OS metadata in parent folders, error text naming the folder and files, disk-space message and size_label.
  • python3 scripts/check.py unit on test_import_publication, test_linked_download, test_capacity_rules, test_automatic_content, test_automatic_eligibility, test_smb_publication: 341 passed. ruff check and ruff format --check clean.
  • Not run: the integration suite (needs PostgreSQL), and the UI specs (they mock the old disk-space string and do not depend on the backend text).
  • Note for reviewers: test_publication_preserves_original_and_keeps_receipts_outside_library[hardlink] fails on main on an overlay/shfs temp directory ("Item contains missing or unplanned files") and passes on tmpfs (TMPDIR=/dev/shm). It fails the same way without this change.

Refs #109, #110

🤖 Generated with Claude Code

- Treat undetermined file languages (und, zxx, mul, mis) as absent tags, so an
  M4B whose only language marker is the MP4 default `und` no longer fails with
  "The files use a different language".
- Ignore OS metadata files (.DS_Store, ._*, Thumbs.db, desktop.ini, ...) when
  checking structural destination folders, and name the folder and files when a
  real file does block publishing.
- Say how much disk space is free, needed and reserved when a download waits for
  space, and where the reserve is configured.
- Return an accurate 409 when a download is started while automatic import is
  only requested (unverified route) instead of "approval changed".

Refs logabell#109, logabell#110

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

1 participant