Prefer structured Zillow photo data before click path

This commit is contained in:
2026-03-28 03:30:42 -05:00
parent 54854edfc6
commit 446d43cc78
5 changed files with 75 additions and 13 deletions

View File

@@ -57,3 +57,12 @@ export function extractZillowStructuredPhotoCandidatesFromNextDataScript(scriptT
return out;
}
export function shouldUseStructuredZillowPhotos(candidates, expectedPhotoCount) {
const count = Array.isArray(candidates) ? candidates.length : 0;
if (!Number.isFinite(expectedPhotoCount) || expectedPhotoCount <= 0) {
return false;
}
return count >= expectedPhotoCount;
}