2.0 KiB
2.0 KiB
Conflicts / Remaining Issues
-
God interface (
AnimeService)internal/domain/anime.gostill defines a largeAnimeServiceinterface (catalog + discover + search + details + staff/stats/reviews).- Needs to be split into smaller interfaces (ISP) and rewired through handlers/services.
-
Domain layer still leaks external models
- While
domain.Useranddomain.Animeare now real types, many other domain types are still direct aliases to integration/DB types (e.g.Genre,Recommendation, etc. ininternal/domain/anime.go). - Goal is a stable domain model that does not break if Jikan/DB structs change.
- While
-
No real DB transactions for multi-write operations
- Multi-step writes (e.g. playback completion / watchlist updates) still do not run inside a database transaction.
- Errors are no longer swallowed in several places, but atomicity is still not guaranteed.
-
DiceBear URL duplication
- Default avatar URL logic is duplicated in
cmd/user/main.goandinternal/database/migrations/016_add_avatar_url.sql. - Needs centralization (or migration updated to match single source of truth).
- Default avatar URL logic is duplicated in
-
AllAnime package-level shared HTTP client
integrations/playback/allanime/client.gostill has a package-level mutablehttp.Client(allAnimeUTLSClient).- Should be instance-owned or injected to avoid cross-test/env coupling.
-
Regex-based parsing of upstream JSON-ish responses
integrations/playback/allanime/extractor.gostill parses provider responses using regex.- Should be replaced with real JSON decoding (or a more robust parser) where possible.
-
Template duplication / drift risk
templates/watchlist.gohtmlandtemplates/watchlist_partial.gohtmlare still separate with overlapping markup.- Inline JS was removed, but the duplication itself remains and can still drift.
-
Remaining handler consistency
- Some modules still have duplicated user extraction patterns and could be unified (e.g.
currentUser()helper usage beyond playback).
- Some modules still have duplicated user extraction patterns and could be unified (e.g.