Admin
fb6b364382
refactor: audit, split server.go, add unit tests, and fix latent bugs
...
- Remove dead code: browser cdp/content_scrape strategies, writer package,
printUsage, downloadAndStoreCoverCLI in main.go
- Fix bugs: defer-in-loop in pocketbase deleteWhere, listAll() pagination
hard cap removed, splitChapterTitle off-by-one in date extraction
- Split server.go (~1700 lines) into focused handler files:
handlers_audio, handlers_browse, handlers_progress, handlers_ranking,
handlers_scrape
- Export htmlutil.AttrVal/TextContent/ResolveURL; add storage/coverutil.go
to consolidate duplicate helpers
- Flatten deeply nested conditionals: voices() early-return guards,
ScrapeCatalogue next-link double attr scan, chapterNumberFromKey dead
strings.Cut line, splitChapterTitle double-nested unit/suffix loop
- Add unit tests: htmlutil (9 funcs), novelfire ScrapeMetadata (3 cases),
orchestrator Run (5 cases), storage chapterNumberFromKey/splitChapterTitle
(22 cases); all pass with go build/vet/test clean
2026-03-04 22:14:23 +05:00
Admin
1b234754e8
feat(orchestrator): add Progress type and OnProgress callback
...
Adds atomic counters for books_found, chapters_scraped, chapters_skipped,
and errors. The new OnProgress callback fires after each counter update
and once more at the end of Run, giving callers a live progress feed.
2026-03-04 00:40:24 +05:00
Admin
18e76c9668
steps 6-8: wire HybridStore into orchestrator, server, and main
...
- Add storage/hybrid.go: HybridStore composing PocketBase + MinIO backends
- Rewrite orchestrator to accept storage.Store instead of *writer.Writer
- Replace *writer.Writer with storage.Store in server.go and ui.go
- Wire audio cache, reading progress, chapter reads/writes through store
- Add rankingCacheAdapter in main.go to bridge context-free RankingPageCacher
interface to HybridStore's context-aware methods
2026-03-02 14:44:02 +05:00