improve error parsing and increase skip default

This commit is contained in:
Josh Hawkins 2026-05-30 23:08:00 -05:00
parent 08be019bed
commit c2d1583397
2 changed files with 10 additions and 4 deletions

View File

@ -42,9 +42,9 @@ class MotionSearchRequest(BaseModel):
description="Minimum change area as a percentage of the ROI", description="Minimum change area as a percentage of the ROI",
) )
frame_skip: int = Field( frame_skip: int = Field(
default=5, default=30,
ge=1, ge=1,
le=30, le=120,
description="Process every Nth frame (1=all frames, 5=every 5th frame)", description="Process every Nth frame (1=all frames, 5=every 5th frame)",
) )
parallel: bool = Field( parallel: bool = Field(

View File

@ -146,7 +146,7 @@ export default function MotionSearchView({
const [parallelMode, setParallelMode] = useState(false); const [parallelMode, setParallelMode] = useState(false);
const [threshold, setThreshold] = useState(30); const [threshold, setThreshold] = useState(30);
const [minArea, setMinArea] = useState(20); const [minArea, setMinArea] = useState(20);
const [frameSkip, setFrameSkip] = useState(10); const [frameSkip, setFrameSkip] = useState(30);
const [maxResults, setMaxResults] = useState(25); const [maxResults, setMaxResults] = useState(25);
// Job state // Job state
@ -846,7 +846,13 @@ export default function MotionSearchView({
responseData.errors; responseData.errors;
if (Array.isArray(apiMessage)) { if (Array.isArray(apiMessage)) {
errorMessage = apiMessage.join(", "); errorMessage = apiMessage
.map((item) =>
typeof item === "string"
? item
: ((item as { msg?: string })?.msg ?? JSON.stringify(item)),
)
.join(", ");
} else if (typeof apiMessage === "string") { } else if (typeof apiMessage === "string") {
errorMessage = apiMessage; errorMessage = apiMessage;
} else if (apiMessage) { } else if (apiMessage) {