snapshot: fix default behavior when snapshot url is provided on cameras without a Camera interface

This commit is contained in:
Koushik Dutta
2023-07-06 08:12:54 -07:00
parent 6d8b3c1ce7
commit 2e9f618f6f
3 changed files with 6 additions and 4 deletions

View File

@@ -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",

View File

@@ -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",

View File

@@ -133,7 +133,9 @@ class SnapshotMixin extends SettingsMixinDeviceBase<Camera> 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;
}