fix(search): respect parsePDF in pricing (#1690)

This commit is contained in:
Gergő Móricz 2025-06-20 21:15:14 +02:00 committed by GitHub
parent 125e1ada45
commit 4b03ffca36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -270,8 +270,9 @@ export async function searchController(
}
}
// TODO: This is horrid. Fix soon - mogery
const credits_billed = responseData.data.reduce((a, x) => {
if (x.metadata?.numPages !== undefined && x.metadata.numPages > 0) {
if (x.metadata?.numPages !== undefined && x.metadata.numPages > 0 && req.body.scrapeOptions?.parsePDF !== false) {
return a + x.metadata.numPages;
} else {
return a + 1;