Merge dev → main: per-post stdout diagnostics + post-field write DRY (#842/#753) #106

Merged
bvandeusen merged 2 commits from dev into main 2026-06-14 23:45:39 -04:00
Owner

Two commits since last main:

eb811e1 — per-post handling in the run stdout. Native ingester writes a per-post line (post <id> [<post_type>] body: N chars, — EMPTY when 0) into the run stdout — shown in the existing "Raw stdout" panel, parity with gallery-dl's per-file output. DRY: write_post_record returns a PostRecordOutcome (downloader owns the read, mirroring download_post → MediaOutcome); ingest_core only formats. Reverted the earlier bespoke structured panel.

0d51b93 — single _apply_post_fields predicate. _apply_sidecar and upsert_post_record had verbatim-duplicate post-field writes; consolidated into one helper both call so the two ingest paths can't diverge (#753). Groundwork for milestone #67 (post-first ingest model).

No migrations. CI green on dev head 0d51b93 (run 1112).

After merge: re-pull :latest, re-run Recapture on StickySpoodge, open the event → Raw stdout → the 9 empties read [<post_type>] body: 0 chars — EMPTY.

Two commits since last main: **`eb811e1` — per-post handling in the run stdout.** Native ingester writes a per-post line (`post <id> [<post_type>] body: N chars`, `— EMPTY` when 0) into the run stdout — shown in the existing "Raw stdout" panel, parity with gallery-dl's per-file output. DRY: `write_post_record` returns a `PostRecordOutcome` (downloader owns the read, mirroring `download_post → MediaOutcome`); `ingest_core` only formats. Reverted the earlier bespoke structured panel. **`0d51b93` — single `_apply_post_fields` predicate.** `_apply_sidecar` and `upsert_post_record` had verbatim-duplicate post-field writes; consolidated into one helper both call so the two ingest paths can't diverge (#753). Groundwork for milestone #67 (post-first ingest model). No migrations. CI green on dev head `0d51b93` (run 1112). After merge: re-pull `:latest`, re-run Recapture on StickySpoodge, open the event → Raw stdout → the 9 empties read `[<post_type>] body: 0 chars — EMPTY`.
bvandeusen added 2 commits 2026-06-14 23:45:33 -04:00
refactor(ingest): per-post handling into run stdout via a downloader outcome (#842)
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 22s
CI / backend-lint-and-test (push) Successful in 38s
CI / integration (push) Successful in 3m18s
eb811e11f6
Two corrections from operator review:
1. Reuse the existing 'Raw stdout' panel instead of a bespoke structured UI
   section — the native ingester now writes a per-post line into the run stdout
   (parity with gallery-dl's per-file stdout), so the per-post handling shows in
   the panel the operator already uses.
2. DRY: stop re-reading post['attributes'] inline in ingest_core. write_post_record
   now returns a PostRecordOutcome (path, post_type, title, body_chars) — mirroring
   the download_post -> MediaOutcome contract — and the downloader owns the read;
   ingest_core only formats the outcome into the log line.

Reverts the post_diagnostics metadata field + DownloadDetailModal 'Post capture'
section added earlier. Per-post line: 'post <id> [<post_type>] body: N chars' (+
' — EMPTY' when 0), so an empty body is self-explanatory by post_type.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
refactor(importer): single _apply_post_fields predicate for both ingest paths (#842/#753)
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 27s
CI / backend-lint-and-test (push) Successful in 42s
CI / integration (push) Successful in 3m22s
0d51b93aa7
The per-media path (_apply_sidecar) and the post-record path (upsert_post_record)
each carried a VERBATIM copy of the post-field write (url/title/date/description/
attachment_count/raw_metadata + external-link sync). Two copies of one concept =
the divergence risk #753 targets. Consolidate into one _apply_post_fields(post,
sd) helper both call — a single predicate for how a post body/links get stored,
so the two sources can't drift. Behavior identical (fill-with-non-empty); both
paths already covered by existing importer tests.

Groundwork for the planned post-first ingest model (single authoritative post
record; media attaches to it) as more platforms move onto the native ingester.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bvandeusen merged commit 59181069da into main 2026-06-14 23:45:39 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledCurator#106