mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-29 08:47:08 +03:00
track where each camera's detect resolution came from
The health tab's stream check told users to set the detect resolution whenever a probe returned no size, even when they had already set it, and a camera running on the 1280x720 fallback after a failed startup probe was never flagged unless the stream check was run by hand. The config now records whether the resolution came from the config, a startup probe, or the fallback, and /api/config exposes it per camera. The stream check skips the probe warning when the resolution is set, a camera on the fallback gets a detect settings warning that also shows on the health tab, and cloning detect from a fallback camera no longer copies the fallback size.
This commit is contained in:
@@ -19,8 +19,19 @@
|
||||
* and no PUT. That path is covered by unit-level review and manual QA.
|
||||
*/
|
||||
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve, dirname } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { test, expect } from "../fixtures/frigate-test";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const CONFIG_SCHEMA = JSON.parse(
|
||||
readFileSync(
|
||||
resolve(__dirname, "../fixtures/mock-data/config-schema.json"),
|
||||
"utf-8",
|
||||
),
|
||||
);
|
||||
|
||||
async function openCloneDialog(frigateApp: {
|
||||
page: import("@playwright/test").Page;
|
||||
}) {
|
||||
@@ -137,6 +148,43 @@ test.describe("Camera clone dialog @medium @mobile", () => {
|
||||
).toBeVisible({ timeout: 8_000 });
|
||||
});
|
||||
|
||||
test("does not copy a fallback detect resolution to a new camera", async ({
|
||||
frigateApp,
|
||||
}) => {
|
||||
await frigateApp.installDefaults({
|
||||
config: {
|
||||
cameras: { front_door: { detect_resolution_source: "default" } },
|
||||
},
|
||||
});
|
||||
// section payloads need the schema, which the default mock leaves empty
|
||||
await frigateApp.page.route("**/api/config/schema.json", (route) =>
|
||||
route.fulfill({ json: CONFIG_SCHEMA }),
|
||||
);
|
||||
const requests: unknown[] = [];
|
||||
await frigateApp.page.route("**/api/config/set", async (route) => {
|
||||
requests.push(route.request().postDataJSON());
|
||||
await route.fulfill({ json: { success: true, require_restart: false } });
|
||||
});
|
||||
|
||||
await frigateApp.goto("/settings?page=cameraManagement");
|
||||
await openCloneDialog(frigateApp);
|
||||
await selectSource(frigateApp, "Front Door");
|
||||
await frigateApp.page
|
||||
.getByPlaceholder(/e\.g\., back_door or Back Door/i)
|
||||
.fill("clone_target_two");
|
||||
await frigateApp.page.getByRole("button", { name: /^Clone$/i }).click();
|
||||
|
||||
await expect.poll(() => requests.length, { timeout: 10_000 }).toBe(1);
|
||||
const body = requests[0] as {
|
||||
config_data: {
|
||||
cameras: { clone_target_two: { detect?: Record<string, unknown> } };
|
||||
};
|
||||
};
|
||||
const detect = body.config_data.cameras.clone_target_two.detect ?? {};
|
||||
expect(detect).not.toHaveProperty("width");
|
||||
expect(detect).not.toHaveProperty("height");
|
||||
});
|
||||
|
||||
test("selects multiple existing destination cameras via a switch popover", async ({
|
||||
frigateApp,
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user