server: publish

This commit is contained in:
Koushik Dutta
2023-01-05 10:06:53 -08:00
parent 95a3d3ce6c
commit 57994f5ffb
3 changed files with 9 additions and 20 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/server",
"version": "0.5.10",
"version": "0.5.11",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/server",
"version": "0.5.10",
"version": "0.5.11",
"license": "ISC",
"dependencies": {
"@ffmpeg-installer/ffmpeg": "^1.1.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/server",
"version": "0.5.10",
"version": "0.5.11",
"description": "",
"dependencies": {
"@ffmpeg-installer/ffmpeg": "^1.1.0",

View File

@@ -203,27 +203,16 @@ export class PluginDeviceProxyHandler implements PrimitiveProxyHandler<any>, Scr
}
return this.mixinTable[0].entry.then(entry => {
let persist = !entry.error;
if (entry.error) {
console.error('Mixin device creation completed with error.');
const allInterfaces = new Set(entry.allInterfaces);
console.error('Mixin device creation completed with error. Merging with previous interface set to retain device descriptor.');
const previousInterfaces = getState(pluginDevice, ScryptedInterfaceProperty.interfaces) as string[] || [];
let containsAll = true;
while (containsAll && previousInterfaces.length) {
containsAll &&= allInterfaces.has(previousInterfaces.pop());
}
persist = containsAll;
if (persist)
console.log('Mixin device completed with interface same set or super set of previous set. Persisting.')
const allInterfaces = new Set([...entry.allInterfaces, ...previousInterfaces]);
entry.allInterfaces = [...allInterfaces];
}
if (persist) {
const changed = this.scrypted.stateManager.setPluginDeviceState(pluginDevice, ScryptedInterfaceProperty.interfaces, PluginDeviceProxyHandler.sortInterfaces(entry.allInterfaces));
if (changed)
this.scrypted.notifyPluginDeviceDescriptorChanged(pluginDevice);
}
const changed = this.scrypted.stateManager.setPluginDeviceState(pluginDevice, ScryptedInterfaceProperty.interfaces, PluginDeviceProxyHandler.sortInterfaces(entry.allInterfaces));
if (changed)
this.scrypted.notifyPluginDeviceDescriptorChanged(pluginDevice);
return pluginDevice;
});
}