Skip to content

Commit

Permalink
videoanalsyis: dont allow extension to be disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Sep 11, 2024
1 parent 67acb77 commit 56dbecb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion common/src/autoenable-mixin-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion plugins/diagnostics/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);
});
};
Expand Down
4 changes: 2 additions & 2 deletions plugins/objectdetector/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/objectdetector/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions plugins/objectdetector/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 56dbecb

Please sign in to comment.