@sublane/core 0.3.1 → 0.3.2
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 +1 -1
- package/src/runtime.ts +11 -2
package/package.json
CHANGED
package/src/runtime.ts
CHANGED
|
@@ -297,7 +297,10 @@ export async function createDetachedSession(opts: CreateDetachedSessionOptions):
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
// pass 2 车道分配(算法同 applyConfig:133-139)+
|
|
300
|
+
// pass 2 车道分配(算法同 applyConfig:133-139)+ 实例创建。
|
|
301
|
+
// F-29(0.3.2):逐家异常隔离——单家构造抛错 = 该家缺席 handles + 日志,会话不 reject,
|
|
302
|
+
// 他家照常(对齐 pass1 getTrack 失败与 R7「单家失败不连坐」);已挂实例归会话所有,
|
|
303
|
+
// dispose 正常清理(不因部分失败泄漏)。失败家的缺席不触发 lane 重排(Q3:重建会话重排)。
|
|
301
304
|
for (const [index, plugin] of admitted.entries()) {
|
|
302
305
|
const lane = { index, count: admitted.length }
|
|
303
306
|
const ctxForDetached: DetachedInstanceContext = {
|
|
@@ -305,7 +308,13 @@ export async function createDetachedSession(opts: CreateDetachedSessionOptions):
|
|
|
305
308
|
config: { enabled: true, lane, settings: frameworkConfig.suppliers[plugin.id]?.settings ?? {} },
|
|
306
309
|
emitConfigPatch: () => {}, // M1:中立化——detached 的 settings 权威在框架键,实例不得回写
|
|
307
310
|
}
|
|
308
|
-
|
|
311
|
+
let instance: VideoSubtitlePluginInstance & { detach(): DetachedHandle }
|
|
312
|
+
try {
|
|
313
|
+
instance = await plugin.createDetachedInstance(ctxForDetached, video, source, options)
|
|
314
|
+
} catch (error) {
|
|
315
|
+
log(`[${plugin.id}] detached 实例创建失败(缺席 handles,其余不受影响):${error instanceof Error ? error.message : error}`)
|
|
316
|
+
continue
|
|
317
|
+
}
|
|
309
318
|
await Promise.resolve(instance.mount()).catch((error: unknown) => log(`[${plugin.id}] detached mount 失败:${error instanceof Error ? error.message : error}`))
|
|
310
319
|
const handle = instance.detach()
|
|
311
320
|
records.push({ id: plugin.id, instance, handle, lane })
|