diff --git a/frontend/app/backend_client.py b/frontend/app/backend_client.py index 8436993..12418ff 100644 --- a/frontend/app/backend_client.py +++ b/frontend/app/backend_client.py @@ -99,8 +99,6 @@ class BackendClient: def play_trigger(self, trigger_id: str, repeat_count: int | None = None) -> dict[str, Any]: path = f"/api/play/{trigger_id}" - if repeat_count is not None: - path += f"?repeat_count={repeat_count}" data = self._request("GET", path) return data if isinstance(data, dict) else {} diff --git a/frontend/app/routes.py b/frontend/app/routes.py index cd3b520..f0f6a18 100644 --- a/frontend/app/routes.py +++ b/frontend/app/routes.py @@ -517,31 +517,14 @@ def play_trigger() -> Response: client = client_or_redirect trigger_id = request.form.get("trigger_id", "").strip() - repeat_count_raw = request.form.get("repeat_count", "").strip() if not trigger_id: if request.headers.get("X-Requested-With") == "fetch": return jsonify({"ok": False, "error": "Identifiant du trigger manquant."}), 400 flash("Identifiant du trigger manquant.", "error") return redirect(url_for("ui.dashboard")) - repeat_count: int | None = None - if repeat_count_raw: - try: - parsed_repeat_count = int(repeat_count_raw) - except ValueError: - if request.headers.get("X-Requested-With") == "fetch": - return jsonify({"ok": False, "error": "Nombre de répétitions invalide."}), 400 - flash("Nombre de répétitions invalide.", "error") - return redirect(url_for("ui.dashboard")) - if parsed_repeat_count < 0: - if request.headers.get("X-Requested-With") == "fetch": - return jsonify({"ok": False, "error": "Le nombre de répétitions doit être >= 0."}), 400 - flash("Le nombre de répétitions doit être >= 0.", "error") - return redirect(url_for("ui.dashboard")) - repeat_count = parsed_repeat_count - try: - client.play_trigger(trigger_id, repeat_count=repeat_count) + client.play_trigger(trigger_id) if request.headers.get("X-Requested-With") == "fetch": return jsonify({"ok": True, "message": "Trigger démarré."}) flash("Trigger démarré.", "success") diff --git a/frontend/app/templates/dashboard.html b/frontend/app/templates/dashboard.html index 06a13c9..9a0414b 100644 --- a/frontend/app/templates/dashboard.html +++ b/frontend/app/templates/dashboard.html @@ -400,9 +400,7 @@ if (!ok) return; playBtn.disabled = true; - const parsedRepeatCount = Number.parseInt(playBtn.dataset.repeatCount || row.dataset.triggerRepeatCount || "0", 10); - const safeRepeatCount = Number.isFinite(parsedRepeatCount) && parsedRepeatCount >= 0 ? String(parsedRepeatCount) : "0"; - const body = new URLSearchParams({ trigger_id: tid, repeat_count: safeRepeatCount }); + const body = new URLSearchParams({ trigger_id: tid }); fetch(url, { method: "POST", headers: { "X-Requested-With": "fetch", "Content-Type": "application/x-www-form-urlencoded" }, @@ -460,9 +458,7 @@ if (!ok) return; btn.disabled = true; - const parsedRepeatCount = Number.parseInt(btn.dataset.repeatCount || row?.dataset.triggerRepeatCount || "0", 10); - const safeRepeatCount = Number.isFinite(parsedRepeatCount) && parsedRepeatCount >= 0 ? String(parsedRepeatCount) : "0"; - const body = new URLSearchParams({ trigger_id: triggerId, repeat_count: safeRepeatCount }); + const body = new URLSearchParams({ trigger_id: triggerId }); fetch(url, { method: "POST", headers: { "X-Requested-With": "fetch", "Content-Type": "application/x-www-form-urlencoded" },