mirror of
https://github.com/koush/scrypted.git
synced 2026-03-01 08:42:57 +00:00
server: mixin table refactor
This commit is contained in:
@@ -427,14 +427,35 @@ export class ScryptedRuntime {
|
||||
}
|
||||
|
||||
// should this be async?
|
||||
invalidatePluginDeviceMixins(id: string) {
|
||||
rebuildPluginDeviceMixinTable(id: string) {
|
||||
const proxyPair = this.devices[id];
|
||||
if (!proxyPair)
|
||||
return;
|
||||
proxyPair.handler.invalidateMixinTable();
|
||||
proxyPair.handler.rebuildMixinTable();
|
||||
return proxyPair;
|
||||
}
|
||||
|
||||
invalidateMixins(mixinIds: Set<string>) {
|
||||
// const ret = new Set(mixinIds);
|
||||
|
||||
// for (const device of Object.values(this.devices)) {
|
||||
// const pluginDevice = this.pluginDevices[device.handler.id];
|
||||
// if (ret.has(pluginDevice._id))
|
||||
// continue;
|
||||
// if (!pluginDevice) {
|
||||
// console.warn('PluginDevice missing?', device.handler.id);
|
||||
// continue;
|
||||
// }
|
||||
// for (const mixin of getState(pluginDevice, ScryptedInterfaceProperty.mixins) || []) {
|
||||
// if (this.scrypted.findPluginDeviceById(mixin)?.pluginId === this.pluginId) {
|
||||
// device.handler.invalidate();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// return ret;
|
||||
}
|
||||
|
||||
async installNpm(pkg: string, version?: string): Promise<PluginHost> {
|
||||
const registry = (await axios(`https://registry.npmjs.org/${pkg}`)).data;
|
||||
if (!version) {
|
||||
|
||||
Reference in New Issue
Block a user