diff --git a/backend/app/services/mediamtx/client.rb b/backend/app/services/mediamtx/client.rb index 86c27f4..60ec0ee 100644 --- a/backend/app/services/mediamtx/client.rb +++ b/backend/app/services/mediamtx/client.rb @@ -40,7 +40,11 @@ module Mediamtx end def delete_path_name(path_name) + return true if path_name.blank? + response = @conn.delete("/v3/config/paths/delete/#{CGI.escape(path_name)}") + return true if response.status == 404 + unless response.success? err = response.body.is_a?(Hash) ? response.body["error"] : response.body raise Error, "MediaMTX path delete failed: #{response.status} #{err}"