scandoc-ai-components 0.0.34 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11218,13 +11218,16 @@ class ExtractorVideo {
|
|
|
11218
11218
|
DOCUMENT_DETECTOR.isDocumentPresent(video).then(async isPresent => {
|
|
11219
11219
|
const now_valid = Date.now();
|
|
11220
11220
|
if (isPresent) {
|
|
11221
|
-
if (!this.wasDocumentPreviouslyDetected) {
|
|
11222
|
-
this.validationStartTime =
|
|
11221
|
+
if (!this.wasDocumentPreviouslyDetected || this.validationStartTime === null) {
|
|
11222
|
+
this.validationStartTime = now_valid;
|
|
11223
|
+
console.log("Document detected. Validation timer started:", this.validationStartTime);
|
|
11224
|
+
this.wasDocumentPreviouslyDetected = true;
|
|
11225
|
+
return;
|
|
11223
11226
|
}
|
|
11224
11227
|
this.wasDocumentPreviouslyDetected = true;
|
|
11225
11228
|
console.log("Validation timer:", {
|
|
11226
11229
|
start: this.validationStartTime,
|
|
11227
|
-
now_valid,
|
|
11230
|
+
now: now_valid,
|
|
11228
11231
|
elapsed: now_valid - this.validationStartTime,
|
|
11229
11232
|
limit: cfgValues.VALIDATION_TIMEOUT_MS
|
|
11230
11233
|
});
|
|
@@ -11295,6 +11298,9 @@ class ExtractorVideo {
|
|
|
11295
11298
|
this.candidateImages = [];
|
|
11296
11299
|
}
|
|
11297
11300
|
} else {
|
|
11301
|
+
if (this.wasDocumentPreviouslyDetected) {
|
|
11302
|
+
console.log("Document lost. Resetting validation timer.");
|
|
11303
|
+
}
|
|
11298
11304
|
this.wasDocumentPreviouslyDetected = false;
|
|
11299
11305
|
this.validationStartTime = null;
|
|
11300
11306
|
}
|