From 161103389135bcf8cdab7ec449eea2370e08d58d Mon Sep 17 00:00:00 2001 From: mkelvers Date: Sun, 26 Apr 2026 18:49:36 +0200 Subject: [PATCH] fix: remove UpdatedAt field from watchlist upsert also add missing currentEpisode query param in HandleAPIEpisodes --- api/anime/handler.go | 3 ++- api/playback/progress.go | 1 - api/watchlist/service.go | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/api/anime/handler.go b/api/anime/handler.go index 4309978..da08ade 100644 --- a/api/anime/handler.go +++ b/api/anime/handler.go @@ -265,7 +265,7 @@ func (h *Handler) HandleAPIAnime(w http.ResponseWriter, r *http.Request) { } statuses := h.watchlistMap(r.Context(), userIDFromRequest(r)) - + w.Header().Set("Cache-Control", "public, max-age=3600") switch section { @@ -324,6 +324,7 @@ func (h *Handler) HandleAPIEpisodes(w http.ResponseWriter, r *http.Request) { w.Header().Set("Cache-Control", "public, max-age=3600") + currentEpisode := r.URL.Query().Get("current") episodes, err := h.getEpisodes(r.Context(), id) if err != nil { log.Printf("episodes error: %v", err) diff --git a/api/playback/progress.go b/api/playback/progress.go index 33b67ed..9e75514 100644 --- a/api/playback/progress.go +++ b/api/playback/progress.go @@ -103,7 +103,6 @@ func (s *Service) CompleteAnime(ctx context.Context, userID string, animeID int6 Status: "completed", CurrentEpisode: sql.NullInt64{Int64: 0, Valid: false}, CurrentTimeSeconds: 0, - UpdatedAt: sql.NullTime{Valid: true}, }); err != nil { return fmt.Errorf("failed to mark watchlist as completed: %w", err) } diff --git a/api/watchlist/service.go b/api/watchlist/service.go index 9823780..f2f18fc 100644 --- a/api/watchlist/service.go +++ b/api/watchlist/service.go @@ -71,7 +71,6 @@ func (s *Service) AddEntry(ctx context.Context, userID string, req AddRequest) e Status: req.Status, CurrentEpisode: sql.NullInt64{Int64: 0, Valid: false}, CurrentTimeSeconds: 0, - UpdatedAt: sql.NullTime{Valid: false}, }) if err != nil { return fmt.Errorf("failed to update watchlist: %w", err)