diff --git a/internal/features/watchlist/handler.go b/internal/features/watchlist/handler.go index 27feec7..3e4dbc5 100644 --- a/internal/features/watchlist/handler.go +++ b/internal/features/watchlist/handler.go @@ -1,6 +1,7 @@ package watchlist import ( + "database/sql" "encoding/json" "errors" "log" @@ -240,6 +241,17 @@ func (h *Handler) HandleDeleteContinueWatching(w http.ResponseWriter, r *http.Re return } + if err := h.svc.db.SaveWatchProgress(r.Context(), database.SaveWatchProgressParams{ + CurrentEpisode: sql.NullInt64{Valid: false}, + CurrentTimeSeconds: 0, + UserID: user.ID, + AnimeID: animeID, + }); err != nil { + log.Printf("continue watching delete failed to clear watchlist progress: user_id=%s anime_id=%d err=%v", user.ID, animeID, err) + http.Error(w, "failed to delete continue watching entry", http.StatusInternalServerError) + return + } + w.WriteHeader(http.StatusOK) }