Build and send a book only when it changed
A key of the chapters, rules and metadata of a story tells if its book changed. A check without a change no longer builds the book again, also for a book that waits for an upload. A held book goes out without a new build. The Rebuild button still builds and sends in each case.
This commit is contained in:
@@ -150,7 +150,7 @@ def test_build_without_ingest_succeeds_and_keeps_the_book_local(monkeypatch, tmp
|
||||
story = orchestrator.store.get_story(story_id)
|
||||
assert story["status"] == "ok"
|
||||
assert story["ingested_at"] == ("2026-01-01" if existing else None)
|
||||
assert (config.TMP_DIR / f"story-{story_id}.epub").exists()
|
||||
assert list(config.TMP_DIR.glob(f"story-{story_id}-*.epub"))
|
||||
assert not (tmp_path / "ingest").exists()
|
||||
details = orchestrator.story_details(story_id)
|
||||
assert details["uploads_paused"] is True
|
||||
@@ -260,7 +260,7 @@ def test_new_story_download_skips_library_matching(monkeypatch, standalone):
|
||||
assert ("Not sent." if standalone else "Sent to ingest folder") in message
|
||||
assert len(orchestrator.store.list_chapters(job.story_id)) == 1
|
||||
assert orchestrator.store.get_story(job.story_id)["status"] == "ok"
|
||||
assert (config.TMP_DIR / f"story-{job.story_id}.epub").exists()
|
||||
assert list(config.TMP_DIR.glob(f"story-{job.story_id}-*.epub"))
|
||||
orchestrator.cwa.assert_not_called()
|
||||
orchestrator._find_book.assert_not_called()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user