feat: one registry entry per Site, one shared Series-page read #95

Merged
sulthan merged 7 commits from feat/94-site-registry into main 2026-08-12 05:43:39 +07:00
2 changed files with 9 additions and 1 deletions
Showing only changes of commit 700de20225 - Show all commits
+7 -1
View File
@@ -124,7 +124,13 @@ func (p *Poller) storeCover(ctx context.Context, sr store.Series, sourceURL stri
// absent, the entry's Fallback decides whether plain TLS may take over. One
// routing rule for the poll and the acquirer, so the two cannot drift apart.
func fetcherFor(site string, browser, tls Fetcher) Fetcher {
s := sites[site]
s, known := sites[site]
if !known {
// No registry entry means nothing to fetch or parse; fail closed even
// though the only caller gates first, so a future caller that skips
// the gate cannot hand an arbitrary https URL to the TLS fetcher.
return nil
}
if s.Browser == nil {
return tls
}
+2
View File
@@ -959,6 +959,8 @@ func TestFetcherForRoutesNovelSites(t *testing.T) {
// browser-less deployment: kagane is nothing, novelfull degrades to TLS
{"kagane", nil, tls, nil},
{"novelfull", nil, tls, tls},
// unknown site: fail closed — nothing to fetch or parse
{"mangadex", browser, tls, nil},
}
for _, tc := range cases {
t.Run(tc.site, func(t *testing.T) {