videoanalsyis: dont allow extension to be disabled.

This commit is contained in:
Koushik Dutta
2024-09-11 08:57:27 -07:00
parent 67acb7725f
commit 56dbecbf3d
5 changed files with 13 additions and 5 deletions

View File

@@ -41,11 +41,15 @@ export abstract class AutoenableMixinProvider extends ScryptedDeviceBase {
return true;
}
checkHasEnabledMixin(device: ScryptedDevice) {
return this.hasEnabledMixin[device.id] === this.autoIncludeToken;
}
async maybeEnableMixin(device: ScryptedDevice) {
if (!device || device.mixins?.includes(this.id))
return;
if (this.hasEnabledMixin[device.id] === this.autoIncludeToken)
if (this.checkHasEnabledMixin(device))
return;
const match = await this.canMixin(device.type, device.interfaces);

View File

@@ -211,7 +211,7 @@ class DiagnosticsPlugin extends ScryptedDeviceBase implements Settings {
const start = Date.now();
await validateMedia(stepName + ' (IDR)', getVideoStream(destination), false, async () => {
const end = Date.now();
if (end - start > 4500)
if (end - start > 5000)
throw new Error(`High IDR Interval. This may cause issues with HomeKit Secure Video. Adjust codec configuration if possible.`);
});
};

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/objectdetector",
"version": "0.1.44",
"version": "0.1.45",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/objectdetector",
"version": "0.1.44",
"version": "0.1.45",
"license": "Apache-2.0",
"dependencies": {
"@scrypted/common": "file:../../common",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/objectdetector",
"version": "0.1.44",
"version": "0.1.45",
"description": "Scrypted Video Analysis Plugin. Installed alongside a detection service like OpenCV or TensorFlow.",
"author": "Scrypted",
"license": "Apache-2.0",

View File

@@ -1059,6 +1059,10 @@ export class ObjectDetectionPlugin extends AutoenableMixinProvider implements Se
}, 10000)
}
checkHasEnabledMixin(device: ScryptedDevice): boolean {
return false;
}
pruneOldStatistics() {
const now = Date.now();
for (const [k, v] of this.objectDetectionStatistics.entries()) {