Prefer structured Zillow photo data before click path
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user