This commit is contained in:
ponzischeme89
2026-08-11 15:18:26 +12:00
parent 594159c0ae
commit 5e5849f985
33 changed files with 1143 additions and 241 deletions
+5 -2
View File
@@ -180,7 +180,10 @@ func (s *Server) handleRequest(w http.ResponseWriter, r *http.Request, sess stor
continue
}
if movie.ID > 0 {
writeError(w, http.StatusConflict, "this movie is already in Radarr")
// Idempotent under a lost response: OkHttp may replay a repeatable POST after
// a connection reset. If the first request already added it, the retry is the
// same successful action rather than an error shown to the viewer.
writeJSON(w, http.StatusOK, map[string]any{"status": "already_added", "title": movie.Title})
return
}
added, err := s.radarr.AddUnmonitored(r.Context(), movie)
@@ -207,7 +210,7 @@ func (s *Server) handleRequest(w http.ResponseWriter, r *http.Request, sess stor
continue
}
if show.ID > 0 {
writeError(w, http.StatusConflict, "this series is already in Sonarr")
writeJSON(w, http.StatusOK, map[string]any{"status": "already_added", "title": show.Title})
return
}
added, err := s.sonarr.AddUnmonitored(r.Context(), show)