@scrypted/server 0.123.6 → 0.123.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrypted/server",
3
- "version": "0.123.6",
3
+ "version": "0.123.7",
4
4
  "description": "",
5
5
  "dependencies": {
6
6
  "@scrypted/ffmpeg-static": "^6.1.0-build3",
@@ -744,9 +744,9 @@ class PluginRemote:
744
744
  self.loop,
745
745
  )
746
746
 
747
- async def loadZip(self, packageJson, getZip: Any, options: dict):
747
+ async def loadZip(self, packageJson, zipAPI: Any, options: dict):
748
748
  try:
749
- return await self.loadZipWrapped(packageJson, getZip, options)
749
+ return await self.loadZipWrapped(packageJson, zipAPI, options)
750
750
  except:
751
751
  print("plugin start/fork failed")
752
752
  traceback.print_exc()
@@ -978,7 +978,7 @@ class PluginRemote:
978
978
  self.deviceManager = DeviceManager(self.nativeIds, self.systemManager)
979
979
  self.mediaManager = MediaManager(await self.api.getMediaManager())
980
980
 
981
- await self.start_stats_runner(zipAPI.updateState)
981
+ await self.start_stats_runner(zipAPI.updateStats)
982
982
 
983
983
  try:
984
984
  from scrypted_sdk import sdk_init2 # type: ignore
@@ -1017,12 +1017,6 @@ class PluginRemote:
1017
1017
  )
1018
1018
  forkPeer.peerName = "thread"
1019
1019
 
1020
- async def updateStats(stats):
1021
- self.ptimeSum += stats["cpu"]["user"]
1022
- self.allMemoryStats[forkPeer] = stats
1023
-
1024
- forkPeer.params["updateStats"] = updateStats
1025
-
1026
1020
  async def forkReadLoop():
1027
1021
  try:
1028
1022
  await readLoop()
@@ -1046,7 +1040,16 @@ class PluginRemote:
1046
1040
  forkOptions = options.copy()
1047
1041
  forkOptions["fork"] = True
1048
1042
  forkOptions["debug"] = debug
1049
- return await remote.loadZip(packageJson, zipAPI.getZip, forkOptions)
1043
+
1044
+ class PluginZipAPI:
1045
+ async def updateStats(stats):
1046
+ self.ptimeSum += stats["cpu"]["user"]
1047
+ self.allMemoryStats[forkPeer] = stats
1048
+
1049
+ async def getZip(self):
1050
+ return await zipAPI.getZip()
1051
+
1052
+ return await remote.loadZip(packageJson, PluginZipAPI(), forkOptions)
1050
1053
 
1051
1054
  pluginFork.result = asyncio.create_task(getFork())
1052
1055
  return pluginFork