From 0a0b4895dee5919db5ca6ede5181ae57c9e4b319 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Thu, 28 May 2026 12:52:10 +0200 Subject: [PATCH] refactor: remove CONFLICTS.md and inline avatar URL from migration --- CONFLICTS.md | 32 ------------------- .../migrations/016_add_avatar_url.sql | 2 -- 2 files changed, 34 deletions(-) delete mode 100644 CONFLICTS.md diff --git a/CONFLICTS.md b/CONFLICTS.md deleted file mode 100644 index 3eb5777..0000000 --- a/CONFLICTS.md +++ /dev/null @@ -1,32 +0,0 @@ -# Conflicts / Remaining Issues - -1. **God interface (`AnimeService`)** - - `internal/domain/anime.go` still defines a large `AnimeService` interface (catalog + discover + search + details + staff/stats/reviews). - - Needs to be split into smaller interfaces (ISP) and rewired through handlers/services. - -2. **Domain layer still leaks external models** - - While `domain.User` and `domain.Anime` are now real types, many other domain types are still direct aliases to integration/DB types (e.g. `Genre`, `Recommendation`, etc. in `internal/domain/anime.go`). - - Goal is a stable domain model that does not break if Jikan/DB structs change. - -3. **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. - -4. **DiceBear URL duplication** - - Default avatar URL logic is duplicated in `cmd/user/main.go` and `internal/database/migrations/016_add_avatar_url.sql`. - - Needs centralization (or migration updated to match single source of truth). - -5. **AllAnime package-level shared HTTP client** - - `integrations/playback/allanime/client.go` still has a package-level mutable `http.Client` (`allAnimeUTLSClient`). - - Should be instance-owned or injected to avoid cross-test/env coupling. - -6. **Regex-based parsing of upstream JSON-ish responses** - - `integrations/playback/allanime/extractor.go` still parses provider responses using regex. - - Should be replaced with real JSON decoding (or a more robust parser) where possible. - -7. **Template duplication / drift risk** - - `templates/watchlist.gohtml` and `templates/watchlist_partial.gohtml` are still separate with overlapping markup. - - Inline JS was removed, but the duplication itself remains and can still drift. - -8. **Remaining handler consistency** - - Some modules still have duplicated user extraction patterns and could be unified (e.g. `currentUser()` helper usage beyond playback). diff --git a/internal/database/migrations/016_add_avatar_url.sql b/internal/database/migrations/016_add_avatar_url.sql index 21abe1f..1083b6b 100644 --- a/internal/database/migrations/016_add_avatar_url.sql +++ b/internal/database/migrations/016_add_avatar_url.sql @@ -1,5 +1,3 @@ -- +goose Up ALTER TABLE user ADD COLUMN avatar_url TEXT NOT NULL DEFAULT ''; - -UPDATE user SET avatar_url = 'https://api.dicebear.com/9.x/dylan/svg?seed=' || username WHERE avatar_url = ''; -- +goose Down