fix: pdf mode and google web cache

This commit is contained in:
yanlong.wang 2024-10-09 17:47:23 +08:00
parent f6bbddcb48
commit e9258af742
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -136,7 +136,8 @@ export class SnapshotFormatter extends AsyncService {
}
let pdfMode = false;
if (snapshot.pdfs?.length && !snapshot.title) {
// in case of Google Web Cache content
if (snapshot.pdfs?.length && (!snapshot.title || snapshot.title.startsWith('cache:'))) {
const pdf = await this.pdfExtractor.cachedExtract(snapshot.pdfs[0],
this.threadLocal.get('cacheTolerance')
);