diff --git a/backend/app/services/mediamtx/client.rb b/backend/app/services/mediamtx/client.rb index 5adc96b..86c27f4 100644 --- a/backend/app/services/mediamtx/client.rb +++ b/backend/app/services/mediamtx/client.rb @@ -40,8 +40,13 @@ module Mediamtx end def delete_path_name(path_name) - @conn.post("/v3/config/paths/delete/#{CGI.escape(path_name)}") + response = @conn.delete("/v3/config/paths/delete/#{CGI.escape(path_name)}") + unless response.success? + err = response.body.is_a?(Hash) ? response.body["error"] : response.body + raise Error, "MediaMTX path delete failed: #{response.status} #{err}" + end forget_always_available(path_name) + true end def set_path_recording(session, enabled:)