Skip to content

filing: failed hardlink no longer writes the processed-book marker - #29

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-0140
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-0140

Conversation

@cursor

@cursor cursor Bot commented Sep 25, 2026

Copy link
Copy Markdown

A matched book whose hardlink (or copy) failed — typically source_path and media_path on different filesystems (EXDEV) — was still given the never-expiring __cache__/book marker. Later runs printed Skipping: … already processed and the files never reached the library. The default template uses /data/torrents/downloads and /data/media/audiobooks/mam, which are often different volumes.

Fix: write the processed marker only when every file was filed, or when dedupe_roots already has the release. isHardlinked is set on dest-exists (a sibling disc that linked last run) and cleared on exception (a stale isHardLinked=True from the log). A calibre ingest success does not hide a failed media-path filing.

Validation: python3 -m unittest discover -s tests -p 'test_*.py' — 224 tests, 0 failures. New cases cover EXDEV then retry, dest-exists, stale log flag, and calibre vs media-path.

Open in Web View Automation 
Open in Web View Automation 

A cross-device (or otherwise failed) hardlink still cached the book under
__cache__/book, which never expires, so the next run skipped it and the
files never reached the library. Write the marker only when every file
was filed or dedupe_roots already has the release.

Co-authored-by: Mancolt <Mancolt@users.noreply.github.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