fix: pass watchlist status to anime detail page

Anime detail page never looked up or passed the user's watchlist
status, so the dropdown always showed 'Add to Watchlist'. Now
queries watch_list_entry and passes Status and WatchlistIDs.
This commit is contained in:
2026-05-13 18:18:22 +02:00
parent 413ee70923
commit 6c45a80623
4 changed files with 23 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ type WatchlistService interface {
UpdateEntry(ctx context.Context, userID string, animeID int64, status string) error
RemoveEntry(ctx context.Context, userID string, animeID int64) error
GetWatchlist(ctx context.Context, userID string) ([]UserWatchListRow, error)
GetWatchListEntry(ctx context.Context, userID string, animeID int64) (WatchlistEntry, error)
GetContinueWatchingEntry(ctx context.Context, userID string, animeID int64) (db.ContinueWatchingEntry, error)
DeleteContinueWatching(ctx context.Context, userID string, animeID int64) error
}
@@ -22,6 +23,7 @@ type WatchlistRepository interface {
UpsertWatchListEntry(ctx context.Context, arg db.UpsertWatchListEntryParams) (db.WatchListEntry, error)
DeleteWatchListEntry(ctx context.Context, arg db.DeleteWatchListEntryParams) error
GetUserWatchList(ctx context.Context, userID string) ([]db.GetUserWatchListRow, error)
GetWatchListEntry(ctx context.Context, arg db.GetWatchListEntryParams) (db.WatchListEntry, error)
GetContinueWatchingEntry(ctx context.Context, arg db.GetContinueWatchingEntryParams) (db.ContinueWatchingEntry, error)
DeleteContinueWatchingEntry(ctx context.Context, arg db.DeleteContinueWatchingEntryParams) error
SaveWatchProgress(ctx context.Context, arg db.SaveWatchProgressParams) error