From 2e9f618f6fb22c524aae9acf24b0a37d1d5c05cf Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Thu, 6 Jul 2023 08:12:54 -0700 Subject: [PATCH] snapshot: fix default behavior when snapshot url is provided on cameras without a Camera interface --- plugins/snapshot/package-lock.json | 4 ++-- plugins/snapshot/package.json | 2 +- plugins/snapshot/src/main.ts | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/snapshot/package-lock.json b/plugins/snapshot/package-lock.json index 860e21cc6..7285b368d 100644 --- a/plugins/snapshot/package-lock.json +++ b/plugins/snapshot/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/snapshot", - "version": "0.0.56", + "version": "0.0.58", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/snapshot", - "version": "0.0.56", + "version": "0.0.58", "dependencies": { "@koush/axios-digest-auth": "^0.8.5", "@types/node": "^18.16.18", diff --git a/plugins/snapshot/package.json b/plugins/snapshot/package.json index a6ee2a861..5bbfcda71 100644 --- a/plugins/snapshot/package.json +++ b/plugins/snapshot/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/snapshot", - "version": "0.0.56", + "version": "0.0.58", "description": "Snapshot Plugin for Scrypted", "scripts": { "scrypted-setup-project": "scrypted-setup-project", diff --git a/plugins/snapshot/src/main.ts b/plugins/snapshot/src/main.ts index 1ed07f391..48df4e66b 100644 --- a/plugins/snapshot/src/main.ts +++ b/plugins/snapshot/src/main.ts @@ -133,7 +133,9 @@ class SnapshotMixin extends SettingsMixinDeviceBase implements Camera { usePrebufferSnapshots = false; break; default: - if (!this.mixinDeviceInterfaces.includes(ScryptedInterface.Camera)) + // default behavior is to use a prebuffer snapshot if there's no camera interface and + // no explicit snapshot url. + if (!this.mixinDeviceInterfaces.includes(ScryptedInterface.Camera) && !this.storageSettings.values.snapshotUrl) usePrebufferSnapshots = true; break; }