The Poll fills blank Covers for every Site and both Libraries #70
Reference in New Issue
Block a user
Delete Branch "feat/61-poll-fill-blank-covers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #61.
Summary
Permanently-blank Series (the half of #47 that creation-time acquisition cannot reach) heal on the next due poll cycle. The cover path is no longer kagane-only: every Site and both Libraries fill a blank Cover from the series page the chapter poll already fetched, and never replace a Cover that already exists.
What changed
backend/internal/latest/poller.gofillBlankCover— whenCoverandCoverAddressare both blank, extract a source URL viacoverFromfrom the series-page body and store bytes throughSetSeriesCover. Skips any Series that already has a source URL (owned by prefetch) or a stored address (never overwrite).prefetchCover— source-URL healing path, now site-uniform. Kagane no longer special-cases intoPutKaganeCoveralone; every Site lands onSetSeriesCover, so the wire Cover becomes a content-addressed public URL. Reuses already-stored bytes when present.storeCover/fetchCoverBytes— shared fetch+persist. Only kagane routes image bytes through the browser fetcher; every other Site uses plain TLSCoverBytesFetch. Failures log with the Series key and never return to the chapter path.checkOne— after a successful series-page fetch, callsfillBlankCoveronce regardless of whether chapter extraction succeeded (cover fill is independent of the chapter signal).backend/internal/latest/poller_test.goExtended the existing poller harness (real store, fake fetchers) rather than a new one:
TestRunOnceFillsBlankCoverFromSeriesPage— asura manga, lightnovelworld novel, kagane manga; asserts wire Cover + correct fetcher routing.TestRunOnceDoesNotReplaceExistingCover— second poll does not refetch.TestRunOnceRetriesFailedBlankCoverOnNextPoll— failed fill stays blank, next due cycle retries (no separate queue).TestRunOnceBlankCoverFailureDoesNotBlockChapter— chapter still lands; failure log carries the Series key.Acceptance criteria (#61)
go test ./...greenOut of scope / not closed
Review notes addressed
PutKaganeCoverbranch from prefetch so source-URL healing also setsCoverAddress(wire Cover).fillBlankCoverdoes not double-fetch afterprefetchCoverhealed the same snapshot.fillBlankCovercall site after the series-page fetch.Test plan
go test ./...(backend; needs Docker/Postgres viapgtest)