Skip to content

A full-featured download manager.

fix(app): defer plugin runtime checks and show migration once (#2368)

Dr_rOot262b8cbd5078
diff --git a/.github/pr-assets/plugin-install-flat-cards.png b/.github/pr-assets/plugin-install-flat-cards.png
new file mode 100644
index 00000000..99994565
Binary files /dev/null and b/.github/pr-assets/plugin-install-flat-cards.png differ
diff --git a/.github/pr-assets/plugin-install-runtime-notice.png b/.github/pr-assets/plugin-install-runtime-notice.png
new file mode 100644
index 00000000..e37e9fcc
Binary files /dev/null and b/.github/pr-assets/plugin-install-runtime-notice.png differ
diff --git a/src/core/plugin/capabilities/ffmpeg.test.ts b/src/core/plugin/capabilities/ffmpeg.test.ts
index 31f912be..35b3ee8f 100644
--- a/src/core/plugin/capabilities/ffmpeg.test.ts
+++ b/src/core/plugin/capabilities/ffmpeg.test.ts
@@ -78,6 +78,76 @@ const UNAVAILABLE_DETECT: FfmpegDetection = {
}
describe('FFmpeg managed pre-spawn trust guard', () => {
+ it('ignores an older probe failure and clears availability only for the latest failed probe', async () => {
+ const host = new FfmpegCapabilityHost({ detect: AVAILABLE_DETECT })
+ let fail!: (error: Error) => void
+ const old = host
+ .refreshDetection(
+ () =>
+ new Promise((_resolve, reject) => {
+ fail = reject
+ })
+ )
+ .catch((error) => error)
+ await host.refreshDetection(async () => ({
+ active: { path: '/new/ffmpeg', version: '8.0' },
+ candidates: [],
+ }))
+ fail(new Error('old probe failed'))
+ await old
+ expect(host.available).toBe(true)
+ expect(host.version).toBe('8.0')
+ await expect(
+ host.refreshDetection(async () => {
+ throw new Error('latest probe failed')
+ })
+ ).rejects.toThrow('latest probe failed')
+ expect(host.available).toBe(false)
+ })
+
+ it('refreshes future calls without interrupting a running process or losing trust checks', async () => {
+ const first = makeFakeProc()
+ const next = makeFakeProc()
+ const spawnFn = vi.fn().mockReturnValueOnce(first).mockReturnValueOnce(next)
+ const validateBinaryPath = vi.fn()
+ const host = new FfmpegCapabilityHost({
+ detect: UNAVAILABLE_DETECT,
+ spawnFn,
+ validateBinaryPath,
+ })
+ host.updateDetection(AVAILABLE_DETECT)
+ expect(host.available).toBe(true)
+ const running = host.run({ argv: [], outputPath: '/output' })
+ host.updateDetection(UNAVAILABLE_DETECT)
+ expect(host.available).toBe(false)
+ await expect(
+ host.run({ argv: [], outputPath: '/blocked' }).result
+ ).rejects.toThrow()
+ expect(first.kill).not.toHaveBeenCalled()
+ first._close(0)
+ await expect(running.result).resolves.toEqual({ outputPath: '/output' })
+ host.updateDetection({
+ available: true,
+ version: '8.0',
+ binaryPath: '/new/ffmpeg',
+ })
+ const refreshed = host.run({ argv: [], outputPath: '/next' })
+ expect(spawnFn.mock.calls.map(([binary]) => binary)).toEqual([
+ '/usr/bin/ffmpeg',
+ '/new/ffmpeg',
+ ])
+ expect(validateBinaryPath).toHaveBeenLastCalledWith('/new/ffmpeg')
+ next._close(0)
+ await refreshed.result
+ validateBinaryPath.mockImplementation(() => {
+ throw new Error('untrusted')
+ })
+ await expect(
+ host.run({ argv: [], outputPath: '/untrusted' }).result
+ ).rejects.toThrow()
+ expect(spawnFn).toHaveBeenCalledTimes(2)
+ })
+
it('does not spawn run or probe when a cached managed binary fails revalidation', async () => {
const spawnFn = vi.fn()
const validateBinaryPath = vi.fn(() => {
diff --git a/src/core/plugin/capabilities/ffmpeg.ts b/src/core/plugin/capabilities/ffmpeg.ts
index d91238c1..de45cbe8 100644
--- a/src/core/plugin/capabilities/ffmpeg.ts
+++ b/src/core/plugin/capabilities/ffmpeg.ts
@@ -31,7 +31,11 @@
import { spawn } from 'node:child_process'
import { randomUUID } from 'node:crypto'
-import type { FfmpegDetection } from './ffmpeg-detect'
+import {
+ type FfmpegDetection,
+ type FfmpegDetectionResult,
+ projectActiveToLegacy,
+} from './ffmpeg-detect'
// Manual merges accept standalone media, never playlists or demuxers that
// discover other files. A file-only protocol allowlist alone still lets HLS,
@@ -242,7 +246,8 @@ function unavailableHandle(id: string): FfmpegOpHandle<{ outputPath: string }> {
}
export class FfmpegCapabilityHost {
- private readonly detect: FfmpegDetection
+ private detect: FfmpegDetection
+ private detectionGeneration = 0
private readonly stagingPathFor: ((p: string) => string) | undefined
private readonly spawnFn: typeof spawn
private readonly validateBinaryPath:
@@ -264,6 +269,29 @@ export class FfmpegCapabilityHost {
return this.detect.version
}
+ /** Refresh future calls after an explicit host probe; running children keep their binary. */
+ updateDetection(detection: FfmpegDetection): void {
+ this.detectionGeneration++
+ this.detect = { ...detection }
+ }
+
+ /** Older probes may finish last, but cannot overwrite the newest requested snapshot. */
+ async refreshDetection(
+ probe: () => Promise<FfmpegDetectionResult>
+ ): Promise<FfmpegDetectionResult> {
+ const generation = ++this.detectionGeneration
+ try {
+ const result = await probe()
+ if (generation === this.detectionGeneration)
+ this.detect = projectActiveToLegacy(result)
+ return result
+ } catch (error) {
+ if (generation === this.detectionGeneration)
+ this.detect = { available: false }
+ throw error
+ }
+ }
+
// -------------------------------------------------------------------------
// run
// -------------------------------------------------------------------------
diff --git a/src/core/plugin/host/plugin-host.test.ts b/src/core/plugin/host/plugin-host.test.ts
index f2cb099a..63086552 100644
--- a/src/core/plugin/host/plugin-host.test.ts
+++ b/src/core/plugin/host/plugin-host.test.ts
@@ -1615,7 +1615,7 @@ describe('PluginHost.activate — ffmpeg snapshot', () => {
await host.shutdown()
})
- it('required + missing → throws ffmpeg_too_old; plugin stays inactive', async () => {
+ it('required dependencies are checked again on enable and activation', async () => {
plantPlugin(path.join(root, 'plugins'), 'req.miss', {
permissions: ['ffmpeg'],
})
@@ -1626,6 +1626,7 @@ describe('PluginHost.activate — ffmpeg snapshot', () => {
hostVersion: '2.5.0',
})
await registry.discover()
+ let available = false
const host = new PluginHost({
registry,
stateStore,
@@ -1634,19 +1635,90 @@ describe('PluginHost.activate — ffmpeg snapshot', () => {
appVersion: '2.5.0',
runtime: 'server',
hostLanguage: 'en-US',
- ffmpegDetect: async () => ({ available: false }),
+ ffmpegDetect: async () => ({ available, version: '7.1' }),
+ })
+ stateStore.setEnabled('req.miss', false)
+ registry.refreshState('req.miss')
+ await expect(host.enable('req.miss')).rejects.toMatchObject({
+ code: ErrorCode.PluginCapabilityUnavailable,
+ message: 'plugin.runtime.ffmpegUnavailable',
})
+ expect(stateStore.get('req.miss')?.enabled).toBe(false)
+ expect(host.isActive('req.miss')).toBe(false)
+ stateStore.setEnabled('req.miss', true)
+ registry.refreshState('req.miss')
await expect(host.activate('req.miss')).rejects.toMatchObject({
- message: 'plugin.manifest.engines.ffmpeg_too_old',
+ message: 'plugin.runtime.ffmpegUnavailable',
})
expect(host.isActive('req.miss')).toBe(false)
expect(stateStore.get('req.miss')?.lastError).toContain(
- 'plugin.manifest.engines.ffmpeg_too_old'
+ 'plugin.runtime.ffmpegUnavailable'
)
+ available = true
+ await expect(host.enable('req.miss')).resolves.toBeUndefined()
+ expect(host.isActive('req.miss')).toBe(false)
+ await host.activate('req.miss')
+ expect(host.isActive('req.miss')).toBe(true)
+ await host.enable('req.miss')
+ expect(stateStore.get('req.miss')?.status).toBe('active')
await host.shutdown()
})
- it('required + version below range → throws ffmpeg_too_old', async () => {
+ it.each(['disable', 'upgrade', 'uninstall', 'shutdown'] as const)(
+ 'does not reopen a plugin after %s supersedes runtime detection',
+ async (mutation) => {
+ plantPlugin(path.join(root, 'plugins'), 'req.race', {
+ permissions: ['ffmpeg'],
+ })
+ registry = new PluginRegistry({
+ pluginsDir: path.join(root, 'plugins'),
+ builtinDir: path.join(root, 'builtin'),
+ stateStore,
+ hostVersion: '2.5.0',
+ })
+ await registry.discover()
+ stateStore.setEnabled('req.race', false)
+ registry.refreshState('req.race')
+ let finish!: (result: { available: boolean; version: string }) => void
+ const host = new PluginHost({
+ registry,
+ stateStore,
+ capabilityHost: capHost,
+ workerScriptPath: workerPath,
+ appVersion: '2.5.0',
+ runtime: 'server',
+ hostLanguage: 'en-US',
+ ffmpegDetect: () =>
+ new Promise((resolve) => {
+ finish = resolve
+ }),
+ })
+ const enabling = host.enable('req.race')
+ const result = enabling.catch((error) => error)
+ if (mutation === 'disable') {
+ await host.disable('req.race', 'plugin.user_disabled', 'disabled', {
+ recordError: false,
+ })
+ } else if (mutation === 'shutdown') {
+ await host.shutdown()
+ } else {
+ if (mutation === 'uninstall')
+ rmSync(path.join(root, 'plugins', 'req.race'), { recursive: true })
+ else
+ plantPlugin(path.join(root, 'plugins'), 'req.race', {
+ permissions: ['ffmpeg'],
+ version: '2.0.0',
+ })
+ await registry.discover()
+ }
+ finish({ available: true, version: '8.0' })
+ expect(await result).toMatchObject({ code: ErrorCode.PluginRuntimeFault })
+ expect(stateStore.get('req.race')?.enabled).toBe(false)
+ await host.shutdown()
+ }
+ )
+
+ it('required + version below range → reports an incompatible runtime', async () => {
plantPlugin(path.join(root, 'plugins'), 'req.below', {
permissions: ['ffmpeg'],
engines: { motrix: '>=2.0.0', ffmpeg: '>=4.4' },
@@ -1673,7 +1745,7 @@ describe('PluginHost.activate — ffmpeg snapshot', () => {
}),
})
await expect(host.activate('req.below')).rejects.toMatchObject({
- message: 'plugin.manifest.engines.ffmpeg_too_old',
+ message: 'plugin.runtime.ffmpegIncompatible',
})
await host.shutdown()
})
diff --git a/src/core/plugin/host/plugin-host.ts b/src/core/plugin/host/plugin-host.ts
index 79eb0cb2..ac227e35 100644
--- a/src/core/plugin/host/plugin-host.ts
+++ b/src/core/plugin/host/plugin-host.ts
@@ -388,6 +388,54 @@ export class PluginHost {
return promise
}
+ /** Probe dependencies, then publish enabled state only if admission stayed current. */
+ async enable(pluginId: string): Promise<void> {
+ const checkPolicy = this.capturePolicyCheck(pluginId)
+ const indexed = this.opts.registry.get(pluginId)
+ if (!indexed) {
+ throw new AppError(
+ ErrorCode.PluginManifestInvalid,
+ `unknown plugin: ${pluginId}`
+ )
+ }
+ if (this.shuttingDown) throw laneAdmissionClosed(pluginId)
+ await this.checkRuntimeRequirements(indexed.manifest)
+ checkPolicy()
+ if (this.shuttingDown) throw laneAdmissionClosed(pluginId)
+ // No await between the final policy check and publishing enabled state.
+ // A disable, upgrade, uninstall or grant change supersedes the old probe.
+ if (!this.opts.stateStore.get(pluginId)?.enabled) {
+ this.opts.stateStore.setEnabled(pluginId, true)
+ this.opts.registry.refreshState(pluginId)
+ }
+ }
+
+ private async checkRuntimeRequirements(
+ manifest: PluginManifest
+ ): Promise<boolean> {
+ const required = manifest.permissions.includes('ffmpeg')
+ const optional = manifest.optionalPermissions?.includes('ffmpeg')
+ if ((!required && !optional) || !this.opts.ffmpegDetect) return true
+ let detection: FfmpegDetection = { available: false }
+ try {
+ detection = await this.opts.ffmpegDetect()
+ } catch {
+ // A probe failure is an unavailable runtime dependency, not a bad package.
+ }
+ const satisfied =
+ detection.available &&
+ ffmpegSatisfies(detection.version ?? '', manifest.engines.ffmpeg ?? null)
+ if (required && !satisfied) {
+ throw new AppError(
+ ErrorCode.PluginCapabilityUnavailable,
+ detection.available
+ ? 'plugin.runtime.ffmpegIncompatible'
+ : 'plugin.runtime.ffmpegUnavailable'
+ )
+ }
+ return satisfied
+ }
+
private async doActivate(
pluginId: string,
attempt: ActivationAttempt
@@ -420,41 +468,24 @@ export class PluginHost {
)
}
- const needsFfmpeg =
- indexed.manifest.permissions.includes('ffmpeg') ||
- (indexed.manifest.optionalPermissions ?? []).includes('ffmpeg')
-
- let ffmpegDetection: FfmpegDetection = { available: false }
- if (needsFfmpeg && this.opts.ffmpegDetect) {
- ffmpegDetection = await this.awaitActivation(
+ let ffmpegAdvertised: boolean
+ try {
+ ffmpegAdvertised = await this.awaitActivation(
pluginId,
attempt,
- this.opts.ffmpegDetect()
- )
- }
-
- const ffmpegSatisfied =
- !this.opts.ffmpegDetect ||
- (ffmpegDetection.available &&
- ffmpegSatisfies(
- ffmpegDetection.version ?? '',
- indexed.manifest.engines.ffmpeg ?? null
- ))
-
- if (indexed.manifest.permissions.includes('ffmpeg') && !ffmpegSatisfied) {
- this.opts.stateStore.recordError(
- pluginId,
- 'plugin.manifest.engines.ffmpeg_too_old'
- )
- this.opts.registry.refreshState(pluginId)
- throw new AppError(
- ErrorCode.PluginManifestInvalid,
- 'plugin.manifest.engines.ffmpeg_too_old'
+ this.checkRuntimeRequirements(indexed.manifest)
)
+ } catch (error) {
+ if (
+ error instanceof AppError &&
+ error.code === ErrorCode.PluginCapabilityUnavailable
+ ) {
+ this.opts.stateStore.recordError(pluginId, error.message)
+ this.opts.registry.refreshState(pluginId)
+ }
+ throw error
}
- const ffmpegAdvertised = !needsFfmpeg || ffmpegSatisfied
-
// manifest.main is only length-validated by the schema; contain it to the
// plugin's own dir so "../../x" can't make us read+eval a file elsewhere.
// Kept unconditionally (including the overlay path below) — cheap and
diff --git a/src/core/plugin/install/e2e-install.test.ts b/src/core/plugin/install/e2e-install.test.ts
index 63f66c9a..57a4be13 100644
--- a/src/core/plugin/install/e2e-install.test.ts
+++ b/src/core/plugin/install/e2e-install.test.ts
@@ -785,49 +785,50 @@ describe('PluginInstaller e2e', () => {
})
})
-describe('PluginInstaller.stage — ffmpeg gate', () => {
- it('required + missing ffmpeg → ABORT unsupported_on_runtime; staging cleaned', async () => {
- const inst = await makeInstaller({
- ffmpegDetect: async () => ({ available: false }),
- })
- const moext = await writeMoext(
- path.join(inputDir, 'req.moext'),
- manifestJSON({ permissions: ['ffmpeg'] })
- )
- await expect(
- inst.stage(moext, { type: 'github', spec: 'example/test' })
- ).rejects.toMatchObject({
- message: 'plugin.manifest.permissions.unsupported_on_runtime',
- })
- const stagingRoot = path.join(pluginsDir, '_staging')
- const leftover = existsSync(stagingRoot) ? await readdir(stagingRoot) : []
- expect(leftover).toEqual([])
- })
-
- it('required + old version → ABORT engines.ffmpeg_too_old (mentions detected version)', async () => {
- const inst = await makeInstaller({
- ffmpegDetect: async () => ({
- available: true,
- version: '3.4.2',
- binaryPath: '/u/b',
- }),
- })
- const moext = await writeMoext(
- path.join(inputDir, 'reqver.moext'),
- manifestJSON({
- permissions: ['ffmpeg'],
- engines: { motrix: '^2.0.0', ffmpeg: '>=4.4' },
+describe('PluginInstaller.stage — advisory ffmpeg detection', () => {
+ it.each(['missing', 'old', 'probe failure'] as const)(
+ 'installs a required FFmpeg plugin when detection reports %s',
+ async (state) => {
+ const inst = await makeInstaller({
+ ffmpegDetect: async () => {
+ if (state === 'probe failure') throw new Error('probe failed')
+ return state === 'old'
+ ? { available: true, version: '3.4.2', binaryPath: '/u/b' }
+ : { available: false }
+ },
})
- )
- await expect(
- inst.stage(moext, { type: 'github', spec: 'example/test' })
- ).rejects.toMatchObject({
- message: expect.stringContaining('3.4.2'),
- })
- const stagingRoot = path.join(pluginsDir, '_staging')
- const leftover = existsSync(stagingRoot) ? await readdir(stagingRoot) : []
- expect(leftover).toEqual([])
- })
+ const moext = await writeMoext(
+ path.join(inputDir, 'req.moext'),
+ manifestJSON({
+ permissions: ['ffmpeg'],
+ engines: { motrix: '^2.0.0', ffmpeg: '>=4.4' },
+ })
+ )
+ const { stagingId, consent } = await inst.stage(moext, {
+ type: 'github',
+ spec: 'example/test',
+ })
+ expect(consent.ffmpegRuntime).toMatchObject({
+ available: state === 'old',
+ satisfiesRange: false,
+ requiredByPlugin: 'required',
+ })
+ await expect(inst.commit(stagingId, {})).resolves.toEqual({
+ pluginId: 'example.test',
+ })
+ expect(
+ JSON.parse(
+ await readFile(
+ path.join(pluginsDir, 'example.test', '_install.json'),
+ 'utf8'
+ )
+ ).consentSnapshot.permissions
+ ).toEqual(['ffmpeg'])
+ const stagingRoot = path.join(pluginsDir, '_staging')
+ const leftover = existsSync(stagingRoot) ? await readdir(stagingRoot) : []
+ expect(leftover).toEqual([])
+ }
+ )
it('optional + missing → succeed; consent reflects degraded', async () => {
const inst = await makeInstaller({
diff --git a/src/core/plugin/install/plugin-installer.ts b/src/core/plugin/install/plugin-installer.ts
index ad1fc116..b636ab59 100644
--- a/src/core/plugin/install/plugin-installer.ts
+++ b/src/core/plugin/install/plugin-installer.ts
@@ -42,7 +42,6 @@ import type { PluginExecutableIdentity } from '../post/delivery-types'
import type { PluginSecurityService } from '../security/security-service'
import type { PluginStateStore } from '../state/plugin-state-store'
import { buildConsentPayload } from './consent-payload'
-import { ffmpegSatisfies } from './ffmpeg-semver'
import {
diffTrustSurface,
readInstallRecord,
@@ -130,9 +129,8 @@ export interface PluginInstallerOptions {
prevRecord: InstallRecord | null
) => { ok: boolean; reason?: string }
/**
- * Snapshots ffmpeg availability at install time. Required when manifests
- * declaring `ffmpeg` permission/optionalPermission are installed; optional
- * otherwise (the gate becomes a no-op).
+ * Advisory availability snapshot for consent. Runtime dependencies are
+ * enforced when enabling/activating the plugin, never while installing it.
*/
ffmpegDetect?: () => Promise<FfmpegDetection>
}
@@ -411,35 +409,10 @@ export class PluginInstaller {
let ffmpegDetection: FfmpegDetection = { available: false }
if (needsFfmpeg && this.opts.ffmpegDetect) {
- ffmpegDetection = await this.opts.ffmpegDetect()
- }
-
- if (parsedManifest.permissions.includes('ffmpeg')) {
- const range = parsedManifest.engines.ffmpeg ?? null
- if (!ffmpegDetection.available) {
- await rm(stagingDir, { recursive: true, force: true })
- throw new AppError(
- ErrorCode.PluginManifestInvalid,
- 'plugin.manifest.permissions.unsupported_on_runtime'
- )
- }
- if (range && !ffmpegSatisfies(ffmpegDetection.version ?? '', range)) {
- await rm(stagingDir, { recursive: true, force: true })
- throw Object.assign(
- new AppError(
- ErrorCode.PluginManifestInvalid,
- 'plugin.manifest.engines.ffmpeg_too_old'
- ),
- {
- details: {
- required: range,
- detected: ffmpegDetection.version,
- },
- message: `ffmpeg ${ffmpegDetection.version} below required ${range}`,
- }
- ) as AppError & {
- details: { required: string; detected: string | undefined }
- }
+ try {
+ ffmpegDetection = await this.opts.ffmpegDetect()
+ } catch {
+ // A failed probe must not prevent storing a valid, consented package.
}
}
diff --git a/src/core/plugin/operations/operation-service.ts b/src/core/plugin/operations/operation-service.ts
index d16d38e5..0b1e2049 100644
--- a/src/core/plugin/operations/operation-service.ts
+++ b/src/core/plugin/operations/operation-service.ts
@@ -747,7 +747,10 @@ export class OperationService {
? undefined
: business && draft.view.descriptor.definition.errors?.[business]
? `operation.error.${business}`
- : /^pluginOperations\.[A-Za-z]+$/.test(message)
+ : /^pluginOperations\.[A-Za-z]+$/.test(message) ||
+ /^plugin\.runtime\.ffmpeg(?:Unavailable|Incompatible)$/.test(
+ message
+ )
? message
: committed
? 'pluginOperations.publicationUncertain'
diff --git a/src/main/index.ts b/src/main/index.ts
index 4c47a43f..db98701d 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -1857,13 +1857,14 @@ async function initializeMainProcess(): Promise<void> {
})
const beginLegacyInvitation = (): void => {
runShellAsyncWork('legacy-import-discovery', async () => {
- const state = await legacyNavigation.detect()
+ await legacyNavigation.detect()
if (
- !state.invitationPending ||
+ !legacyNavigation.getState().invitationPending ||
!gate.isAccepted() ||
!mainProcessWork.isAccepting()
)
return
+ legacyNavigation.finishInvitation()
windowManager?.open('main', { show: true })
navigateToMigration()
})
@@ -2088,7 +2089,9 @@ async function initializeMainProcess(): Promise<void> {
userDataDir: app.getPath('userData'),
})
const detectPluginFfmpeg = async () =>
- projectActiveToLegacy(await detectElectronFfmpeg())
+ projectActiveToLegacy(
+ await pluginCapHost.ffmpeg.refreshDetection(detectElectronFfmpeg)
+ )
const activePluginHost = new PluginHost({
security: pluginSecurity,
onSecurityChanged: () => {
diff --git a/src/main/ipc/commands.test.ts b/src/main/ipc/commands.test.ts
index 952de4bb..e5e54830 100644
--- a/src/main/ipc/commands.test.ts
+++ b/src/main/ipc/commands.test.ts
@@ -257,6 +257,7 @@ function fakeCtx() {
saveTaskWithInstances: vi.fn(),
},
pluginHost: {
+ enable: vi.fn().mockResolvedValue(undefined),
allActive: vi.fn(() => []),
deactivate: vi.fn().mockResolvedValue(undefined),
isQuiescent: vi.fn(() => true),
@@ -2749,12 +2750,19 @@ describe('plugin enable/disable commands', () => {
...fakeCtx(),
pluginStateStore: {
setEnabled,
- get: vi.fn().mockReturnValue(undefined),
+ get: vi.fn(() => ({
+ status: 'inactive',
+ enabled: Boolean(setEnabled.mock.calls.at(-1)?.[1]),
+ })),
},
pluginRegistry: {
refreshState,
},
pluginHost: {
+ enable: vi.fn(async (id: string) => {
+ setEnabled(id, true)
+ refreshState(id)
+ }),
deactivate: vi.fn().mockResolvedValue(undefined),
disable: vi.fn(async (id: string) => {
setEnabled(id, false)
@@ -2770,6 +2778,24 @@ describe('plugin enable/disable commands', () => {
}
}
+ it('keeps a plugin disabled when a runtime dependency is missing', async () => {
+ const ctx = makePluginLifecycleCtx()
+ ctx.pluginHost.enable.mockRejectedValueOnce(
+ new Error('plugin.runtime.ffmpegUnavailable')
+ )
+ const handlers = buildCommandHandlers(ctx as unknown as CommandContext)
+ await expect(
+ handlers[Commands.EnablePlugin]?.('test-plugin')
+ ).rejects.toThrow('plugin.runtime.ffmpegUnavailable')
+ expect(ctx.pluginStateStore.setEnabled).not.toHaveBeenCalled()
+ expect(ctx.eventBus.emit).not.toHaveBeenCalled()
+ await handlers[Commands.EnablePlugin]?.('test-plugin')
+ expect(ctx.pluginStateStore.setEnabled).toHaveBeenCalledWith(
+ 'test-plugin',
+ true
+ )
+ })
+
it('emits contribution index changes when enabling a plugin', async () => {
const ctx = makePluginLifecycleCtx()
const handlers = buildCommandHandlers(ctx as unknown as CommandContext)
diff --git a/src/main/ipc/commands.ts b/src/main/ipc/commands.ts
index 6c245cfe..76f94388 100644
--- a/src/main/ipc/commands.ts
+++ b/src/main/ipc/commands.ts
@@ -1626,19 +1626,15 @@ export function buildCommandHandlers(ctx: CommandContext): CommandHandlerMap {
}),
[Commands.EnablePlugin]: async (id: string) => {
- pluginRegistry.assertSecurityAllowed?.(id)
- pluginStateStore.setEnabled(id, true)
- // Sync the in-memory IndexedPlugin.state so Queries.ListPlugins and
- // downstream gating (PluginHost.activate, ActivationDispatcher,
- // CrossPluginInvoker) see the new enabled flag without a process
- // restart.
- pluginRegistry.refreshState(id)
+ await pluginHost.enable(id)
const state = pluginStateStore.get(id)
- eventBus.emit(Events.PluginStatusChanged, {
- id,
- status: state?.status ?? 'inactive',
- enabled: true,
- })
+ if (state) {
+ eventBus.emit(Events.PluginStatusChanged, {
+ id,
+ status: state.status,
+ enabled: state.enabled,
+ })
+ }
eventBus.emit(Events.ContributionIndexChanged)
return { ok: true }
},
diff --git a/src/main/ipc/queries.test.ts b/src/main/ipc/queries.test.ts
index f50423c3..894775a5 100644
--- a/src/main/ipc/queries.test.ts
+++ b/src/main/ipc/queries.test.ts
@@ -3,6 +3,7 @@ import { tmpdir } from 'node:os'
import path from 'node:path'
import { TaskActivityService, type TaskActivityStore } from '@core/activity'
import { createTaskInspectorActivityQuery } from '@core/inspector-activity'
+import { FfmpegCapabilityHost } from '@core/plugin/capabilities/ffmpeg'
import { ErrorCode } from '@shared/errors'
import { PROTOCOL_ENVELOPE_VERSION } from '@shared/protocol/errors'
import { Queries } from '@shared/protocol/queries'
@@ -770,6 +771,36 @@ describe('GetFfmpegDetection handler', () => {
mockedFfmpegFactory.mockClear()
})
+ it('does not let an older detection replace a newer unavailable result', async () => {
+ const oldResult = {
+ active: { path: '/old/ffmpeg', version: '7.0' },
+ candidates: [],
+ }
+ let finish!: (result: typeof oldResult) => void
+ const probe = vi
+ .fn()
+ .mockImplementationOnce(
+ () =>
+ new Promise((resolve) => {
+ finish = resolve
+ })
+ )
+ .mockResolvedValueOnce({ active: null, candidates: [] })
+ mockedFfmpegFactory.mockReturnValueOnce(probe)
+ const ffmpeg = new FfmpegCapabilityHost({ detect: { available: false } })
+ const ctx = {
+ settingsManager: {},
+ userDataDir: '/data',
+ capabilityHost: { ffmpeg },
+ } as unknown as QueryContext
+ const handlers = buildQueryHandlers(ctx)
+ const old = handlers[Queries.GetFfmpegDetection]?.()
+ await handlers[Queries.GetFfmpegDetection]?.()
+ finish(oldResult)
+ await old
+ expect(ffmpeg.available).toBe(false)
+ })
+
it('returns the enriched detection result from the factory', async () => {
const fakeDetection = {
active: { path: '/u/ffmpeg', version: '6.0.1' },
@@ -799,7 +830,9 @@ describe('GetFfmpegDetection handler', () => {
const settingsManager = {
get: vi.fn(() => ({ media: { ffmpegBinaryPath: '/u/ffmpeg' } })),
}
+ const ffmpeg = new FfmpegCapabilityHost({ detect: { available: false } })
const ctx = {
+ capabilityHost: { ffmpeg },
settingsManager,
userDataDir: '/data',
} as unknown as QueryContext
@@ -807,6 +840,8 @@ describe('GetFfmpegDetection handler', () => {
const handlers = buildQueryHandlers(ctx)
const result = await handlers[Queries.GetFfmpegDetection]?.()
expect(result).toEqual(fakeDetection)
+ expect(ffmpeg.available).toBe(true)
+ expect(ffmpeg.version).toBe(fakeDetection.active.version)
expect(mockedFfmpegFactory).toHaveBeenCalledWith({
settingsManager,
userDataDir: '/data',
diff --git a/src/main/ipc/queries.ts b/src/main/ipc/queries.ts
index 4fcfd6e7..787366b2 100644
--- a/src/main/ipc/queries.ts
+++ b/src/main/ipc/queries.ts
@@ -283,7 +283,8 @@ export function buildQueryHandlers(ctx: QueryContext): QueryHandlerMap {
return getFfmpegInstallStatus(userDataDir)
},
- [Queries.GetFfmpegDetection]: async () => detectFfmpeg(),
+ [Queries.GetFfmpegDetection]: async () =>
+ capabilityHost.ffmpeg.refreshDetection(detectFfmpeg),
[Queries.GetTaskBtTracker]: createGetTaskBtTrackerHandler({
engineAdapter,
diff --git a/src/main/legacy-import/navigation-state.test.ts b/src/main/legacy-import/navigation-state.test.ts
index 771c5694..873b918e 100644
--- a/src/main/legacy-import/navigation-state.test.ts
+++ b/src/main/legacy-import/navigation-state.test.ts
@@ -3,9 +3,13 @@ import { describe, expect, it, vi } from 'vitest'
import { LegacyImportNavigation } from './navigation-state'
function fixture(sources: LegacyImportSource[] = []) {
+ let dismissed = false
const service = {
discover: vi.fn(async () => sources),
- invitationDismissed: vi.fn(() => false),
+ invitationDismissed: vi.fn(() => dismissed),
+ dismissInvitation: vi.fn(() => {
+ dismissed = true
+ }),
}
const deps = {
hasConsent: vi.fn(() => true),
@@ -45,6 +49,54 @@ describe('legacy main navigation state', () => {
invitationPending: false,
})
})
+ it('persists the first invitation even if the user leaves without choosing', async () => {
+ const f = fixture([
+ { sourceHandle: 'old', name: 'Motrix', dataPath: '/old' },
+ ])
+ expect(await f.navigation.detect()).toEqual({
+ detected: true,
+ invitationPending: true,
+ })
+ await f.navigation.detect()
+ expect(f.service.dismissInvitation).toHaveBeenCalledTimes(1)
+ // A new navigation instance models restarting with the same persisted flag.
+ const restarted = new LegacyImportNavigation(f.deps)
+ expect(await restarted.detect()).toEqual({
+ detected: true,
+ invitationPending: false,
+ })
+ expect(f.service.dismissInvitation).toHaveBeenCalledTimes(1)
+ restarted.sourceDetected()
+ expect(restarted.getState().detected).toBe(true)
+ })
+ it('does not return a consumed invitation from its cached discovery', async () => {
+ const f = fixture([
+ { sourceHandle: 'old', name: 'Motrix', dataPath: '/old' },
+ ])
+ await f.navigation.detect()
+ f.navigation.finishInvitation()
+ expect(await f.navigation.detect()).toEqual({
+ detected: true,
+ invitationPending: false,
+ })
+ })
+
+ it('does not consume the invitation when no v1 source is found', async () => {
+ const f = fixture()
+ await f.navigation.detect()
+ expect(f.service.dismissInvitation).not.toHaveBeenCalled()
+ })
+ it('does not invite until its consumed state can be persisted', async () => {
+ const f = fixture([
+ { sourceHandle: 'old', name: 'Motrix', dataPath: '/old' },
+ ])
+ f.service.dismissInvitation.mockImplementationOnce(() => {
+ throw new Error('storage unavailable')
+ })
+ await expect(f.navigation.detect()).rejects.toThrow('storage unavailable')
+ expect(f.navigation.getState().invitationPending).toBe(false)
+ expect((await f.navigation.detect()).invitationPending).toBe(true)
+ })
it('does not pretend a failed detection found v1 and permits a later retry', async () => {
const f = fixture()
f.service.discover.mockRejectedValueOnce(new Error('unavailable'))
diff --git a/src/main/legacy-import/navigation-state.ts b/src/main/legacy-import/navigation-state.ts
index 25059892..94b4505c 100644
--- a/src/main/legacy-import/navigation-state.ts
+++ b/src/main/legacy-import/navigation-state.ts
@@ -14,7 +14,7 @@ export class LegacyImportNavigation {
hasConsent: () => boolean
getService: () => Pick<
LegacyImportService,
- 'discover' | 'invitationDismissed'
+ 'discover' | 'invitationDismissed' | 'dismissInvitation'
>
roots: () => string[]
changed: () => void
@@ -33,14 +33,20 @@ export class LegacyImportNavigation {
'legacyImport.errors.consentRequired'
)
)
- if (this.discovery) return this.discovery
+ if (this.discovery) return this.discovery.then(() => this.getState())
this.discovery = (async () => {
const service = this.deps.getService()
const sources = await service.discover(this.deps.roots())
if (!this.deps.hasConsent()) return this.getState()
+ const invitationPending =
+ sources.length > 0 && !service.invitationDismissed()
+ // Consume the automatic invitation before publishing it. Closing the
+ // app or leaving the page without choosing import/skip must not invite
+ // again on the next launch. Manual migration remains available.
+ if (invitationPending) service.dismissInvitation()
this.state = {
detected: this.state.detected || sources.length > 0,
- invitationPending: sources.length > 0 && !service.invitationDismissed(),
+ invitationPending,
}
this.deps.changed()
return this.getState()
diff --git a/src/renderer/routes/plugins/components/plugin-card.test.tsx b/src/renderer/routes/plugins/components/plugin-card.test.tsx
index c4f62088..075fcfce 100644
--- a/src/renderer/routes/plugins/components/plugin-card.test.tsx
+++ b/src/renderer/routes/plugins/components/plugin-card.test.tsx
@@ -1,5 +1,5 @@
import '@testing-library/jest-dom/vitest'
-import { fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'
import { MemoryRouter, Route, Routes, useLocation } from 'react-router'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import '@renderer/lib/i18n'
@@ -192,19 +192,30 @@ describe('PluginCard', () => {
)
})
- it('applies the disabled state locally after a successful Switch command', async () => {
+ it('does not overwrite a newer enabled event when a disable response arrives late', async () => {
const plugin = makePlugin()
usePluginsStore.getState().setList([plugin])
+ let finish!: () => void
+ mockInvoke.mockReturnValueOnce(
+ new Promise<void>((resolve) => {
+ finish = resolve
+ })
+ )
renderCard(plugin)
-
fireEvent.click(screen.getByRole('switch'))
-
- await waitFor(() =>
- expect(usePluginsStore.getState().list[0]).toMatchObject({
- enabled: false,
- status: 'disabled',
- })
+ // Another window enabled the plugin after this window requested disable.
+ act(() =>
+ usePluginsStore
+ .getState()
+ .applyStatus(plugin.id, 'active', undefined, true)
)
+ await act(async () => {
+ finish()
+ })
+ expect(usePluginsStore.getState().list[0]).toMatchObject({
+ enabled: true,
+ status: 'active',
+ })
})
it('does not nest the Switch inside the card navigation target', () => {
diff --git a/src/renderer/routes/plugins/components/plugin-card.tsx b/src/renderer/routes/plugins/components/plugin-card.tsx
index d5514ec9..c91e46b3 100644
--- a/src/renderer/routes/plugins/components/plugin-card.tsx
+++ b/src/renderer/routes/plugins/components/plugin-card.tsx
@@ -2,12 +2,11 @@ import { Badge } from '@renderer/components/ui/badge'
import { Button } from '@renderer/components/ui/button'
import { Card } from '@renderer/components/ui/card'
import { Switch } from '@renderer/components/ui/switch'
-import { transport } from '@renderer/lib/transport'
-import { Commands } from '@shared/protocol/commands'
import type { PluginListDTO } from '@shared/types/plugin'
import type { MouseEvent as ReactMouseEvent } from 'react'
import { useTranslation } from 'react-i18next'
import { useNavigate } from 'react-router'
+import { usePluginEnabled } from '../hooks/use-plugin-enabled'
import {
computePluginAudience,
type PrimaryActionKind,
@@ -34,7 +33,7 @@ const PRIMARY_ACTION_TAB: Partial<Record<PrimaryActionKind, string>> = {
export function PluginCard({ plugin, hasSchema }: Props) {
const { t } = useTranslation()
const navigate = useNavigate()
- const applyStatus = usePluginsStore((s) => s.applyStatus)
+ const { toggleEnabled, pending } = usePluginEnabled(plugin.id)
// Real grants — store is hydrated by usePlugins via Queries.ListPluginGrants.
// Without this the audience falsely flags every plugin-with-optional-perms
// as needing "Grant access" (deriveTone treats `undefined` grants as
@@ -50,14 +49,6 @@ export function PluginCard({ plugin, hasSchema }: Props) {
)
const oneLine = truncateOneLine(plugin.description, 90)
- async function toggleEnabled(next: boolean) {
- await transport.invoke(
- next ? Commands.EnablePlugin : Commands.DisablePlugin,
- plugin.id
- )
- applyStatus(plugin.id, next ? 'inactive' : 'disabled', undefined, next)
- }
-
function handleCardClick(event: ReactMouseEvent) {
// Disabled switches do not dispatch their own click handler.
if (
@@ -110,7 +101,7 @@ export function PluginCard({ plugin, hasSchema }: Props) {
<Switch
checked={plugin.enabled && !plugin.security}
- disabled={!!plugin.security}
+ disabled={pending || !!plugin.security}
aria-label={t('plugins.detail.enabled')}
onClick={stopPropagation}
onCheckedChange={toggleEnabled}
diff --git a/src/renderer/routes/plugins/components/registry-detail-panel.tsx b/src/renderer/routes/plugins/components/registry-detail-panel.tsx
index 9eb12152..b571bfda 100644
--- a/src/renderer/routes/plugins/components/registry-detail-panel.tsx
+++ b/src/renderer/routes/plugins/components/registry-detail-panel.tsx
@@ -66,7 +66,7 @@ export function RegistryDetailPanel({ entry }: Props) {
<ScrollAreaViewport className="min-h-0 flex-1 overscroll-contain">
<ScrollAreaContent style={{ minWidth: '100%' }}>
<div className="mx-auto flex w-full flex-col gap-4 pb-6">
- <Card className="flex flex-col gap-4 p-4">
+ <Card className="flex flex-col gap-4 p-4 shadow-none">
<div className="flex items-start gap-3">
<PluginAvatar
plugin={{ id: entry.id, name, icon: entry.icon }}
@@ -121,7 +121,7 @@ export function RegistryDetailPanel({ entry }: Props) {
</Card>
{features.length > 0 && (
- <Card className="flex flex-col gap-2 p-4">
+ <Card className="flex flex-col gap-2 p-4 shadow-none">
<h3 className="text-sm font-semibold tracking-tight">
{t('plugins.registry.featuresTitle')}
</h3>
@@ -134,7 +134,7 @@ export function RegistryDetailPanel({ entry }: Props) {
)}
{permissionChips.length > 0 && (
- <Card className="flex flex-col gap-2 p-4">
+ <Card className="flex flex-col gap-2 p-4 shadow-none">
<h3 className="text-sm font-semibold tracking-tight">
{t('plugins.registry.permissionsTitle')}
</h3>
diff --git a/src/renderer/routes/plugins/hooks/use-plugin-enabled.test.tsx b/src/renderer/routes/plugins/hooks/use-plugin-enabled.test.tsx
new file mode 100644
index 00000000..71496696
--- /dev/null
+++ b/src/renderer/routes/plugins/hooks/use-plugin-enabled.test.tsx
@@ -0,0 +1,89 @@
+import '@renderer/lib/i18n'
+import { Commands } from '@shared/protocol/commands'
+import { act, renderHook } from '@testing-library/react'
+import i18n from 'i18next'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+import { usePluginEnabled } from './use-plugin-enabled'
+
+const { invoke, addToast, applyStatus } = vi.hoisted(() => ({
+ invoke: vi.fn(),
+ addToast: vi.fn(),
+ applyStatus: vi.fn(),
+}))
+vi.mock('@renderer/lib/transport', () => ({ transport: { invoke } }))
+vi.mock('@renderer/components/ui/toast', () => ({ toast: { add: addToast } }))
+vi.mock('../store', () => ({
+ usePluginsStore: (select: (state: unknown) => unknown) =>
+ select({ applyStatus }),
+}))
+
+beforeEach(async () => {
+ vi.clearAllMocks()
+ invoke.mockResolvedValue({ ok: true })
+ await i18n.changeLanguage('en-US')
+})
+afterEach(async () => {
+ await i18n.changeLanguage('en-US')
+})
+
+describe('plugin enable runtime feedback', () => {
+ it.each([
+ ['ffmpegUnavailable', 'FFmpeg is unavailable.'],
+ ['ffmpegIncompatible', 'The FFmpeg version does not meet'],
+ ])(
+ 'localizes %s from Electron without changing enabled state',
+ async (code, text) => {
+ invoke.mockRejectedValueOnce(
+ new Error(
+ `Error invoking remote method 'command:enablePlugin': AppError: plugin.runtime.${code}`
+ )
+ )
+ const { result } = renderHook(() => usePluginEnabled('community.test'))
+ await act(() => result.current.toggleEnabled(true))
+ expect(addToast).toHaveBeenCalledWith(
+ expect.objectContaining({
+ type: 'error',
+ title: expect.stringContaining(text),
+ })
+ )
+ expect(applyStatus).not.toHaveBeenCalled()
+ expect(result.current.pending).toBe(false)
+ }
+ )
+
+ it('uses the current host language for a server runtime failure', async () => {
+ await i18n.changeLanguage('zh-CN')
+ invoke.mockRejectedValueOnce(new Error('plugin.runtime.ffmpegUnavailable'))
+ const { result } = renderHook(() => usePluginEnabled('community.test'))
+ await act(() => result.current.toggleEnabled(true))
+ expect(addToast).toHaveBeenCalledWith(
+ expect.objectContaining({
+ title: i18n.t('plugin.runtime.ffmpegUnavailable'),
+ })
+ )
+ expect(applyStatus).not.toHaveBeenCalled()
+ })
+
+ it('serializes repeated clicks without overwriting authoritative status on completion', async () => {
+ let resolve!: () => void
+ invoke.mockReturnValueOnce(
+ new Promise<void>((done) => {
+ resolve = done
+ })
+ )
+ const { result } = renderHook(() => usePluginEnabled('community.test'))
+ act(() => {
+ void result.current.toggleEnabled(true)
+ void result.current.toggleEnabled(true)
+ })
+ expect(invoke).toHaveBeenCalledTimes(1)
+ expect(invoke).toHaveBeenCalledWith(Commands.EnablePlugin, 'community.test')
+ expect(applyStatus).not.toHaveBeenCalled()
+ expect(result.current.pending).toBe(true)
+ await act(async () => {
+ resolve()
+ })
+ expect(applyStatus).not.toHaveBeenCalled()
+ expect(result.current.pending).toBe(false)
+ })
+})
diff --git a/src/renderer/routes/plugins/hooks/use-plugin-enabled.ts b/src/renderer/routes/plugins/hooks/use-plugin-enabled.ts
new file mode 100644
index 00000000..ca55cea0
--- /dev/null
+++ b/src/renderer/routes/plugins/hooks/use-plugin-enabled.ts
@@ -0,0 +1,49 @@
+import { toast } from '@renderer/components/ui/toast'
+import { transport } from '@renderer/lib/transport'
+import { Commands } from '@shared/protocol/commands'
+import { useCallback, useRef, useState } from 'react'
+import { useTranslation } from 'react-i18next'
+
+const runtimeMessages = [
+ 'plugin.runtime.ffmpegUnavailable',
+ 'plugin.runtime.ffmpegIncompatible',
+ 'plugins.security.blocked',
+ 'plugins.security.pending',
+] as const
+
+/** Both plugin surfaces preserve the current switch state on admission failure. */
+export function usePluginEnabled(pluginId: string) {
+ const { t } = useTranslation()
+ const inFlight = useRef(false)
+ const [pending, setPending] = useState(false)
+ const toggleEnabled = useCallback(
+ async (next: boolean) => {
+ if (inFlight.current) return
+ inFlight.current = true
+ setPending(true)
+ try {
+ await transport.invoke(
+ next ? Commands.EnablePlugin : Commands.DisablePlugin,
+ pluginId
+ )
+ // usePlugins mirrors authoritative status events. A delayed response
+ // must not overwrite a newer disable/uninstall event with local intent.
+ } catch (error) {
+ const message = error instanceof Error ? error.message : String(error)
+ const key = message.includes('plugin.runtime.admission_closed:')
+ ? 'pluginOperations.blocked'
+ : runtimeMessages.find((candidate) => message.endsWith(candidate))
+ toast.add({
+ type: 'error',
+ title: key ? t(key) : t('common.error'),
+ ...(!key ? { description: message } : {}),
+ })
+ } finally {
+ inFlight.current = false
+ setPending(false)
+ }
+ },
+ [pluginId, t]
+ )
+ return { toggleEnabled, pending }
+}
diff --git a/src/renderer/routes/plugins/plugin-detail-page.test.tsx b/src/renderer/routes/plugins/plugin-detail-page.test.tsx
index d01f531c..7bb9df43 100644
--- a/src/renderer/routes/plugins/plugin-detail-page.test.tsx
+++ b/src/renderer/routes/plugins/plugin-detail-page.test.tsx
@@ -290,7 +290,7 @@ describe('PluginDetailPage', () => {
expect(screen.getByRole('button', { name: 'Clear' })).toBeDisabled()
})
- it('Switch toggles plugin enabled state through command and local store', async () => {
+ it('Switch sends its command without overwriting host status events', async () => {
const user = userEvent.setup()
renderAt('/plugins/test.demo')
@@ -300,12 +300,7 @@ describe('PluginDetailPage', () => {
'command:disablePlugin',
'test.demo'
)
- expect(mockApplyStatus).toHaveBeenCalledWith(
- 'test.demo',
- 'disabled',
- undefined,
- false
- )
+ expect(mockApplyStatus).not.toHaveBeenCalled()
})
it('renders Uninstall icon button beside Logs', () => {
diff --git a/src/renderer/routes/plugins/plugin-detail-page.tsx b/src/renderer/routes/plugins/plugin-detail-page.tsx
index 8850979f..a5de7317 100644
--- a/src/renderer/routes/plugins/plugin-detail-page.tsx
+++ b/src/renderer/routes/plugins/plugin-detail-page.tsx
@@ -53,6 +53,7 @@ import { RegistryInstallAction } from './components/registry-install-action'
import { RegistryNetworkNotice } from './components/registry-network-notice'
import { UninstallSection } from './components/uninstall-section'
import { usePluginDetail } from './hooks/use-plugin-detail'
+import { usePluginEnabled } from './hooks/use-plugin-enabled'
import { usePlugins } from './hooks/use-plugins'
import { useRegistryEntry, useRegistryUpdates } from './hooks/use-registry'
import { type UpdateChannel, usePluginsStore } from './store'
@@ -76,7 +77,7 @@ export function PluginDetailPage() {
usePlugins()
const pluginsLoaded = usePluginsStore((s) => s.loaded)
const listEntry = usePluginsStore((s) => s.list.find((p) => p.id === id))
- const applyStatus = usePluginsStore((s) => s.applyStatus)
+ const { toggleEnabled, pending: togglingEnabled } = usePluginEnabled(id)
const update = usePluginsStore((s) => s.updates[id])
const [updateOpen, setUpdateOpen] = useState(false)
// Snapshot of update.channel taken when the dialog opens. The dialog's own
@@ -156,14 +157,6 @@ export function PluginDetailPage() {
? 'operations'
: 'overview'
- async function toggleEnabled(next: boolean) {
- await transport.invoke(
- next ? Commands.EnablePlugin : Commands.DisablePlugin,
- id
- )
- applyStatus(id, next ? 'inactive' : 'disabled', undefined, next)
- }
-
return (
<>
<PanelShell
@@ -206,7 +199,7 @@ export function PluginDetailPage() {
id="plugin-detail-enabled"
aria-label={t('plugins.detail.enabled')}
checked={listEntry.enabled && !listEntry.security}
- disabled={!!listEntry.security}
+ disabled={togglingEnabled || !!listEntry.security}
onCheckedChange={toggleEnabled}
/>
</div>
diff --git a/src/renderer/routes/plugins/plugin-install-dialog.test.tsx b/src/renderer/routes/plugins/plugin-install-dialog.test.tsx
index ede107f6..f69baa81 100644
--- a/src/renderer/routes/plugins/plugin-install-dialog.test.tsx
+++ b/src/renderer/routes/plugins/plugin-install-dialog.test.tsx
@@ -142,7 +142,7 @@ describe('PluginInstallDialog — ffmpegRuntime block', () => {
expect(screen.getByTestId('install-commit-btn')).toBeEnabled()
})
- it('renders red ABORT block when required + !satisfies; disables commit', () => {
+ it('warns about a missing required runtime but still allows installation', () => {
state.consent = withFfmpeg({
available: false,
satisfiesRange: false,
@@ -150,10 +150,12 @@ describe('PluginInstallDialog — ffmpegRuntime block', () => {
})
state.stagingId = 's1'
render(<PluginInstallDialog open onOpenChange={vi.fn()} />)
- expect(screen.getByTestId('ffmpeg-runtime-block')).toHaveClass(
- /destructive/
+ expect(screen.getByTestId('ffmpeg-runtime-block')).not.toHaveClass(
+ 'text-destructive'
)
- expect(screen.getByTestId('install-commit-btn')).toBeDisabled()
+ expect(screen.getByTestId('install-commit-btn')).toBeEnabled()
+ fireEvent.click(screen.getByTestId('install-commit-btn'))
+ expect(state.confirm).toHaveBeenCalled()
})
it('renders yellow notice when optional + !available; commit enabled', () => {
diff --git a/src/renderer/routes/plugins/plugin-install-dialog.tsx b/src/renderer/routes/plugins/plugin-install-dialog.tsx
index 43416777..814f787a 100644
--- a/src/renderer/routes/plugins/plugin-install-dialog.tsx
+++ b/src/renderer/routes/plugins/plugin-install-dialog.tsx
@@ -15,7 +15,6 @@ import {
ScrollBar,
} from '@renderer/components/ui/scroll-area'
import { Spinner } from '@renderer/components/ui/spinner'
-import { cn } from '@renderer/lib/utils'
import type { ConsentPayloadFfmpegRuntime } from '@shared/types/plugin-install'
import {
type ReactNode,
@@ -43,16 +42,11 @@ function FfmpegRuntimeBlock({ rt }: { rt: ConsentPayloadFfmpegRuntime }) {
if (rt.requiredByPlugin === 'none') return null
const hasProblem = !rt.available || rt.satisfiesRange === false
if (!hasProblem) return null
- const blocking = rt.requiredByPlugin === 'required'
return (
<div
data-testid="ffmpeg-runtime-block"
- className={cn(
- 'mb-4 rounded-md border p-3 text-xs',
- blocking
- ? 'border-destructive bg-destructive/10 text-destructive'
- : 'border-amber-300 bg-amber-100 text-amber-900'
- )}
+ role="status"
+ className="mb-4 rounded-md border border-amber-300 bg-amber-100 p-3 text-xs text-amber-900"
>
<div className="font-semibold">{t('plugin.install.ffmpeg.title')}</div>
<div>
@@ -61,7 +55,7 @@ function FfmpegRuntimeBlock({ rt }: { rt: ConsentPayloadFfmpegRuntime }) {
: t('plugin.install.ffmpeg.notInstalled')}
</div>
<div>
- {blocking
+ {rt.requiredByPlugin === 'required'
? t('plugin.install.ffmpeg.requiredByPlugin')
: t('plugin.install.ffmpeg.optionalDegraded')}
</div>
@@ -202,10 +196,6 @@ function PluginInstallSession({
if (await install.startInstall(args)) close()
}
- const ffmpegBlocking =
- install.consent?.ffmpegRuntime.requiredByPlugin === 'required' &&
- (install.consent.ffmpegRuntime.available === false ||
- install.consent.ffmpegRuntime.satisfiesRange === false)
useEffect(() => {
if (open && install.consent) cancelButtonRef.current?.focus()
}, [open, install.consent])
@@ -346,7 +336,7 @@ function PluginInstallSession({
size="sm"
onClick={onInstall}
data-testid="install-commit-btn"
- disabled={!install.consent || install.pending || ffmpegBlocking}
+ disabled={!install.consent || install.pending}
>
{committing && <Spinner aria-hidden="true" />}
{t('plugins.consent.confirm')}
diff --git a/src/server/index.ts b/src/server/index.ts
index 1b5dba70..93ad9822 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -599,7 +599,9 @@ async function main() {
userDataDir: platform.userDataDir,
})
const detectPluginFfmpeg = async () =>
- projectActiveToLegacy(await detectServerFfmpeg())
+ projectActiveToLegacy(
+ await pluginCapHost.ffmpeg.refreshDetection(detectServerFfmpeg)
+ )
const pluginHost = new PluginHost({
security: pluginSecurity,
onSecurityChanged: () => {
diff --git a/src/server/ipc/commands.test.ts b/src/server/ipc/commands.test.ts
index 4fde89d5..6eb7c3fc 100644
--- a/src/server/ipc/commands.test.ts
+++ b/src/server/ipc/commands.test.ts
@@ -147,9 +147,16 @@ function makeFakeCtx() {
hostVersion: '2.0',
pluginStateStore: {
setEnabled,
- get: vi.fn().mockReturnValue(undefined),
+ get: vi.fn(() => ({
+ status: 'inactive',
+ enabled: Boolean(setEnabled.mock.calls.at(-1)?.[1]),
+ })),
} as unknown as PluginStateStore,
pluginHost: {
+ enable: vi.fn(async (id: string) => {
+ setEnabled(id, true)
+ refreshState(id)
+ }),
deactivate: vi.fn().mockResolvedValue(undefined),
disable: vi.fn(async (id: string) => {
setEnabled(id, false)
@@ -1659,6 +1666,26 @@ describe('server Commands.UpdatePluginConfig', () => {
})
describe('server plugin enable/disable commands', () => {
+ it('keeps a plugin disabled when a runtime dependency is missing', async () => {
+ const ctx = makeFakeCtx()
+ vi.spyOn(ctx.pluginHost, 'enable').mockRejectedValueOnce(
+ new Error('plugin.runtime.ffmpegUnavailable')
+ )
+ const handlers = buildServerCommandHandlers(
+ ctx as Parameters<typeof buildServerCommandHandlers>[0]
+ )
+ await expect(
+ handlers[Commands.EnablePlugin]?.('test-plugin')
+ ).rejects.toThrow('plugin.runtime.ffmpegUnavailable')
+ expect(ctx.pluginStateStore.setEnabled).not.toHaveBeenCalled()
+ expect(ctx.eventBus.emit).not.toHaveBeenCalled()
+ await handlers[Commands.EnablePlugin]?.('test-plugin')
+ expect(ctx.pluginStateStore.setEnabled).toHaveBeenCalledWith(
+ 'test-plugin',
+ true
+ )
+ })
+
it('emits contribution index changes when enabling a plugin', async () => {
const ctx = makeFakeCtx()
const handlers = buildServerCommandHandlers(
diff --git a/src/server/ipc/commands.ts b/src/server/ipc/commands.ts
index d56ae561..ccf9ab29 100644
--- a/src/server/ipc/commands.ts
+++ b/src/server/ipc/commands.ts
@@ -949,19 +949,15 @@ export function buildServerCommandHandlers(
},
[Commands.EnablePlugin]: async (id: string) => {
- pluginRegistry.assertSecurityAllowed?.(id)
- pluginStateStore.setEnabled(id, true)
- // Sync the in-memory IndexedPlugin.state so Queries.ListPlugins and
- // downstream gating (PluginHost.activate, ActivationDispatcher,
- // CrossPluginInvoker) see the new enabled flag without a process
- // restart.
- pluginRegistry.refreshState(id)
+ await pluginHost.enable(id)
const state = pluginStateStore.get(id)
- eventBus.emit(Events.PluginStatusChanged, {
- id,
- status: state?.status ?? 'inactive',
- enabled: true,
- })
+ if (state) {
+ eventBus.emit(Events.PluginStatusChanged, {
+ id,
+ status: state.status,
+ enabled: state.enabled,
+ })
+ }
eventBus.emit(Events.ContributionIndexChanged)
return { ok: true }
},
diff --git a/src/server/ipc/queries.test.ts b/src/server/ipc/queries.test.ts
index bbd0548f..b3853fb7 100644
--- a/src/server/ipc/queries.test.ts
+++ b/src/server/ipc/queries.test.ts
@@ -4,12 +4,14 @@ import path from 'node:path'
import { TaskActivityService, type TaskActivityStore } from '@core/activity'
import { createTaskInspectorActivityQuery } from '@core/inspector-activity'
import { NotificationCenter } from '@core/notifications/notification-center'
+import { FfmpegCapabilityHost } from '@core/plugin/capabilities/ffmpeg'
import { MotrixDatabase } from '@core/session/motrix-database'
import { ErrorCode } from '@shared/errors'
import { Queries } from '@shared/protocol/queries'
import { generalSettingsSnapshot } from '@test-utils/general-settings'
import { makeDownloadTask } from '@test-utils/task'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+import { makeServerFfmpegDetect } from '../plugin/ffmpeg-detect-server'
import { buildServerQueryHandlers, type ServerQueryContext } from './queries'
vi.mock('../plugin/ffmpeg-detect-server', () => ({
@@ -775,3 +777,35 @@ describe('plugin diagnostic state query', () => {
expect(getLogState).not.toHaveBeenCalled()
})
})
+
+describe('server FFmpeg detection refresh', () => {
+ it('updates the operation capability after explicit detection and when FFmpeg disappears', async () => {
+ const ffmpeg = new FfmpegCapabilityHost({ detect: { available: false } })
+ const detected = {
+ active: { path: '/media/ffmpeg', version: '8.0' },
+ candidates: [],
+ }
+ vi.mocked(makeServerFfmpegDetect).mockReturnValueOnce(async () => detected)
+ const handlers = buildServerQueryHandlers(
+ makeCtx({
+ capabilityHost: { ffmpeg },
+ }) as unknown as ServerQueryContext
+ )
+ await expect(handlers[Queries.GetFfmpegDetection]?.()).resolves.toEqual(
+ detected
+ )
+ expect(ffmpeg.available).toBe(true)
+ expect(ffmpeg.version).toBe('8.0')
+ vi.mocked(makeServerFfmpegDetect).mockReturnValueOnce(async () => ({
+ active: null,
+ candidates: [],
+ }))
+ const missing = buildServerQueryHandlers(
+ makeCtx({
+ capabilityHost: { ffmpeg },
+ }) as unknown as ServerQueryContext
+ )
+ await missing[Queries.GetFfmpegDetection]?.()
+ expect(ffmpeg.available).toBe(false)
+ })
+})
diff --git a/src/server/ipc/queries.ts b/src/server/ipc/queries.ts
index 74a7e481..1cdfc4f3 100644
--- a/src/server/ipc/queries.ts
+++ b/src/server/ipc/queries.ts
@@ -338,7 +338,8 @@ export function buildServerQueryHandlers(
[Queries.GetTaskBtTracker]: async ({ engineGid }: { engineGid: string }) =>
engineAdapter.getTaskBtTracker(engineGid),
- [Queries.GetFfmpegDetection]: async () => detectFfmpeg(),
+ [Queries.GetFfmpegDetection]: async () =>
+ capabilityHost.ffmpeg.refreshDetection(detectFfmpeg),
[Queries.ListPlugins]: async () => pluginRegistry.list(),
diff --git a/src/shared/locales/ar.json b/src/shared/locales/ar.json
index 2eabb051..780b4444 100644
--- a/src/shared/locales/ar.json
+++ b/src/shared/locales/ar.json
@@ -1322,10 +1322,14 @@
"ffmpeg": {
"notInstalled": "FFmpeg غير مثبّت على هذا النظام.",
"optionalDegraded": "لن تتوفر ميزات الوسائط في هذه الإضافة حتى تثبيت ffmpeg.",
- "requiredByPlugin": "تتطلب هذه الإضافة ffmpeg. ثبّته وحاول مجددًا.",
+ "requiredByPlugin": "يمكنك تثبيت الإضافة الآن. اضبط إصدارًا متوافقًا من FFmpeg قبل تفعيلها أو تشغيلها.",
"title": "متطلبات FFmpeg",
"versionMismatch": "FFmpeg {{version}} مثبّت."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg غير متاح. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "إصدار FFmpeg لا يفي بمتطلبات هذه الإضافة. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"plugins": {
diff --git a/src/shared/locales/bg.json b/src/shared/locales/bg.json
index 217ec40a..12433293 100644
--- a/src/shared/locales/bg.json
+++ b/src/shared/locales/bg.json
@@ -1274,10 +1274,14 @@
"ffmpeg": {
"notInstalled": "FFmpeg не е инсталиран на тази система.",
"optionalDegraded": "Мултимедийните функции на тази приставка няма да са достъпни, докато не бъде инсталиран ffmpeg.",
- "requiredByPlugin": "Тази приставка изисква ffmpeg. Инсталирайте го и опитайте отново.",
+ "requiredByPlugin": "Можете да инсталирате приставката сега. Преди да я активирате или стартирате, настройте съвместима версия на FFmpeg.",
"title": "Изискване за FFmpeg",
"versionMismatch": "Инсталиран е FFmpeg {{version}}."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg не е достъпен. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "Версията на FFmpeg не отговаря на изискванията на тази приставка. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"plugins": {
diff --git a/src/shared/locales/ca.json b/src/shared/locales/ca.json
index 382a8614..84e10efe 100644
--- a/src/shared/locales/ca.json
+++ b/src/shared/locales/ca.json
@@ -1286,10 +1286,14 @@
"ffmpeg": {
"notInstalled": "L'FFmpeg no està instal·lat en aquest sistema.",
"optionalDegraded": "Les funcions multimèdia d'aquest connector no estaran disponibles fins que s'instal·li l'ffmpeg.",
- "requiredByPlugin": "Aquest connector necessita l'ffmpeg. Instal·leu-lo i torneu-ho a provar.",
+ "requiredByPlugin": "Pots instal·lar el complement ara. Configura una versió compatible de FFmpeg abans d’activar-lo o executar-lo.",
"title": "Requisit d'FFmpeg",
"versionMismatch": "L'FFmpeg {{version}} està instal·lat."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg no està disponible. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "La versió de FFmpeg no compleix els requisits d’aquest complement. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"plugins": {
diff --git a/src/shared/locales/de.json b/src/shared/locales/de.json
index 32f23cd8..51ff787c 100644
--- a/src/shared/locales/de.json
+++ b/src/shared/locales/de.json
@@ -2757,9 +2757,13 @@
"title": "FFmpeg-Voraussetzung",
"notInstalled": "FFmpeg ist auf diesem System nicht installiert.",
"versionMismatch": "FFmpeg {{version}} ist installiert.",
- "requiredByPlugin": "Dieses Plugin erfordert ffmpeg. Installieren Sie es und versuchen Sie es erneut.",
+ "requiredByPlugin": "Das Plugin kann jetzt installiert werden. Richte vor dem Aktivieren oder Ausführen eine kompatible FFmpeg-Version ein.",
"optionalDegraded": "Die Medienfunktionen dieses Plugins sind erst verfügbar, wenn ffmpeg installiert ist."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg ist nicht verfügbar. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "Die FFmpeg-Version erfüllt die Anforderungen dieses Plugins nicht. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/el.json b/src/shared/locales/el.json
index bb072db1..16202be6 100644
--- a/src/shared/locales/el.json
+++ b/src/shared/locales/el.json
@@ -1274,10 +1274,14 @@
"ffmpeg": {
"notInstalled": "Το FFmpeg δεν είναι εγκατεστημένο σε αυτό το σύστημα.",
"optionalDegraded": "Οι λειτουργίες πολυμέσων αυτού του πρόσθετου δεν θα είναι διαθέσιμες μέχρι να εγκατασταθεί το ffmpeg.",
- "requiredByPlugin": "Αυτό το πρόσθετο απαιτεί ffmpeg. Εγκαταστήστε το και δοκιμάστε ξανά.",
+ "requiredByPlugin": "Μπορείτε να εγκαταστήσετε το πρόσθετο τώρα. Ρυθμίστε μια συμβατή έκδοση του FFmpeg πριν το ενεργοποιήσετε ή το εκτελέσετε.",
"title": "Απαίτηση FFmpeg",
"versionMismatch": "Είναι εγκατεστημένο το FFmpeg {{version}}."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "Το FFmpeg δεν είναι διαθέσιμο. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "Η έκδοση του FFmpeg δεν πληροί τις απαιτήσεις αυτού του πρόσθετου. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"plugins": {
diff --git a/src/shared/locales/en-US.json b/src/shared/locales/en-US.json
index 02f82bc4..77e21a74 100644
--- a/src/shared/locales/en-US.json
+++ b/src/shared/locales/en-US.json
@@ -2757,9 +2757,13 @@
"title": "FFmpeg requirement",
"notInstalled": "FFmpeg is not installed on this system.",
"versionMismatch": "FFmpeg {{version}} is installed.",
- "requiredByPlugin": "This plugin requires ffmpeg. Install it and try again.",
+ "requiredByPlugin": "You can install now. Configure compatible FFmpeg before enabling or running this plugin.",
"optionalDegraded": "This plugin’s media features will be unavailable until ffmpeg is installed."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg is unavailable. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "The FFmpeg version does not meet this plugin’s requirements. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/es.json b/src/shared/locales/es.json
index 7a97f3d6..0c529eb4 100644
--- a/src/shared/locales/es.json
+++ b/src/shared/locales/es.json
@@ -2778,9 +2778,13 @@
"title": "Requisito de FFmpeg",
"notInstalled": "FFmpeg no está instalado en este sistema.",
"versionMismatch": "FFmpeg {{version}} está instalado.",
- "requiredByPlugin": "Este plugin requiere ffmpeg. Instálalo y vuelve a intentarlo.",
+ "requiredByPlugin": "Puedes instalar el complemento ahora. Configura una versión compatible de FFmpeg antes de activarlo o ejecutarlo.",
"optionalDegraded": "Las funciones multimedia de este plugin no estarán disponibles hasta que se instale ffmpeg."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg no está disponible. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "La versión de FFmpeg no cumple los requisitos de este complemento. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/fa.json b/src/shared/locales/fa.json
index 5bc2123f..d12c9cfe 100644
--- a/src/shared/locales/fa.json
+++ b/src/shared/locales/fa.json
@@ -1274,10 +1274,14 @@
"ffmpeg": {
"notInstalled": "FFmpeg روی این سیستم نصب نیست.",
"optionalDegraded": "تا نصب ffmpeg، قابلیت‌های رسانهٔ این افزونه در دسترس نخواهند بود.",
- "requiredByPlugin": "این افزونه به ffmpeg نیاز دارد. آن را نصب کنید و دوباره تلاش کنید.",
+ "requiredByPlugin": "می‌توانید افزونه را اکنون نصب کنید. پیش از فعال‌سازی یا اجرا، نسخهٔ سازگار FFmpeg را پیکربندی کنید.",
"title": "نیازمندی FFmpeg",
"versionMismatch": "FFmpeg {{version}} نصب شده است."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg در دسترس نیست. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "نسخهٔ FFmpeg الزامات این افزونه را برآورده نمی‌کند. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"plugins": {
diff --git a/src/shared/locales/fr.json b/src/shared/locales/fr.json
index 67bab6a9..579607e6 100644
--- a/src/shared/locales/fr.json
+++ b/src/shared/locales/fr.json
@@ -1286,10 +1286,14 @@
"ffmpeg": {
"notInstalled": "FFmpeg n’est pas installé sur ce système.",
"optionalDegraded": "Les fonctions multimédias de cette extension seront indisponibles tant que ffmpeg ne sera pas installé.",
- "requiredByPlugin": "Cette extension nécessite ffmpeg. Installez-le et réessayez.",
+ "requiredByPlugin": "Vous pouvez installer le plugin maintenant. Configurez une version compatible de FFmpeg avant de l’activer ou de l’exécuter.",
"title": "Exigence FFmpeg",
"versionMismatch": "FFmpeg {{version}} est installé."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg est indisponible. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "La version de FFmpeg ne répond pas aux exigences de ce plugin. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"plugins": {
diff --git a/src/shared/locales/hu.json b/src/shared/locales/hu.json
index 289dab50..e39f9670 100644
--- a/src/shared/locales/hu.json
+++ b/src/shared/locales/hu.json
@@ -2757,9 +2757,13 @@
"title": "FFmpeg-követelmény",
"notInstalled": "Az FFmpeg nincs telepítve ezen a rendszeren.",
"versionMismatch": "Az FFmpeg {{version}} verziója van telepítve.",
- "requiredByPlugin": "Ehhez a bővítményhez FFmpeg szükséges. Telepítsd, majd próbáld újra.",
+ "requiredByPlugin": "A bővítmény most telepíthető. Engedélyezés vagy futtatás előtt állítson be egy kompatibilis FFmpeg-verziót.",
"optionalDegraded": "A bővítmény médiafunkciói nem lesznek elérhetők, amíg az FFmpeg nincs telepítve."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "Az FFmpeg nem érhető el. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "Az FFmpeg verziója nem felel meg a bővítmény követelményeinek. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/id.json b/src/shared/locales/id.json
index d9c43abe..55b509b9 100644
--- a/src/shared/locales/id.json
+++ b/src/shared/locales/id.json
@@ -2736,9 +2736,13 @@
"title": "Kebutuhan FFmpeg",
"notInstalled": "FFmpeg belum terpasang pada sistem ini.",
"versionMismatch": "FFmpeg {{version}} terpasang.",
- "requiredByPlugin": "Plugin ini memerlukan ffmpeg. Pasang dan coba lagi.",
+ "requiredByPlugin": "Anda dapat memasang plugin sekarang. Konfigurasikan FFmpeg yang kompatibel sebelum mengaktifkan atau menjalankan plugin.",
"optionalDegraded": "Fitur media plugin ini tidak tersedia hingga ffmpeg dipasang."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg tidak tersedia. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "Versi FFmpeg tidak memenuhi persyaratan plugin ini. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/it.json b/src/shared/locales/it.json
index 13e4f34e..de86d093 100644
--- a/src/shared/locales/it.json
+++ b/src/shared/locales/it.json
@@ -2778,9 +2778,13 @@
"title": "Requisito FFmpeg",
"notInstalled": "FFmpeg non è installato su questo sistema.",
"versionMismatch": "È installato FFmpeg {{version}}.",
- "requiredByPlugin": "Questo plugin richiede ffmpeg. Installalo e riprova.",
+ "requiredByPlugin": "Puoi installare il plugin ora. Configura una versione compatibile di FFmpeg prima di attivarlo o eseguirlo.",
"optionalDegraded": "Le funzionalità multimediali di questo plugin non saranno disponibili finché non verrà installato ffmpeg."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg non è disponibile. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "La versione di FFmpeg non soddisfa i requisiti di questo plugin. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/ja.json b/src/shared/locales/ja.json
index 9af2b29d..7f361d73 100644
--- a/src/shared/locales/ja.json
+++ b/src/shared/locales/ja.json
@@ -2736,9 +2736,13 @@
"title": "FFmpeg の要件",
"notInstalled": "このシステムに FFmpeg がインストールされていません。",
"versionMismatch": "FFmpeg {{version}} がインストールされています。",
- "requiredByPlugin": "このプラグインには ffmpeg が必要です。インストールしてから、もう一度お試しください。",
+ "requiredByPlugin": "プラグインは今すぐインストールできます。有効化または実行する前に、互換性のある FFmpeg を設定してください。",
"optionalDegraded": "ffmpeg をインストールするまで、このプラグインのメディア機能は利用できません。"
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg を利用できません。 Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "FFmpeg のバージョンがこのプラグインの要件を満たしていません。 Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/ko.json b/src/shared/locales/ko.json
index ca3148ce..27de077f 100644
--- a/src/shared/locales/ko.json
+++ b/src/shared/locales/ko.json
@@ -2736,9 +2736,13 @@
"title": "FFmpeg 요구 사항",
"notInstalled": "이 시스템에 FFmpeg가 설치되어 있지 않습니다.",
"versionMismatch": "설치된 FFmpeg 버전: {{version}}.",
- "requiredByPlugin": "이 플러그인에는 ffmpeg가 필요합니다. 설치한 후 다시 시도하세요.",
+ "requiredByPlugin": "플러그인은 지금 설치할 수 있습니다. 활성화하거나 실행하기 전에 호환되는 FFmpeg를 설정하세요.",
"optionalDegraded": "ffmpeg를 설치하기 전까지 이 플러그인의 미디어 기능을 사용할 수 없습니다."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg를 사용할 수 없습니다. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "FFmpeg 버전이 이 플러그인의 요구 사항을 충족하지 않습니다. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/nb.json b/src/shared/locales/nb.json
index 80a7e507..373be66b 100644
--- a/src/shared/locales/nb.json
+++ b/src/shared/locales/nb.json
@@ -1274,10 +1274,14 @@
"ffmpeg": {
"notInstalled": "FFmpeg er ikke installert på dette systemet.",
"optionalDegraded": "Mediefunksjonene i dette programtillegget er utilgjengelige inntil ffmpeg er installert.",
- "requiredByPlugin": "Dette programtillegget krever ffmpeg. Installer det og prøv igjen.",
+ "requiredByPlugin": "Du kan installere utvidelsen nå. Konfigurer en kompatibel FFmpeg-versjon før du aktiverer eller kjører den.",
"title": "FFmpeg-krav",
"versionMismatch": "FFmpeg {{version}} er installert."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg er ikke tilgjengelig. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "FFmpeg-versjonen oppfyller ikke kravene til denne utvidelsen. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"plugins": {
diff --git a/src/shared/locales/nl.json b/src/shared/locales/nl.json
index 9019d5e5..93f5c540 100644
--- a/src/shared/locales/nl.json
+++ b/src/shared/locales/nl.json
@@ -1274,10 +1274,14 @@
"ffmpeg": {
"notInstalled": "FFmpeg is niet geïnstalleerd op dit systeem.",
"optionalDegraded": "De mediafuncties van deze plug-in zijn niet beschikbaar totdat ffmpeg is geïnstalleerd.",
- "requiredByPlugin": "Deze plug-in vereist ffmpeg. Installeer het en probeer het opnieuw.",
+ "requiredByPlugin": "Je kunt de plug-in nu installeren. Stel een compatibele FFmpeg-versie in voordat je de plug-in inschakelt of uitvoert.",
"title": "FFmpeg-vereiste",
"versionMismatch": "FFmpeg {{version}} is geïnstalleerd."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg is niet beschikbaar. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "De FFmpeg-versie voldoet niet aan de vereisten van deze plug-in. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"plugins": {
diff --git a/src/shared/locales/pl.json b/src/shared/locales/pl.json
index d97f092e..8a64147a 100644
--- a/src/shared/locales/pl.json
+++ b/src/shared/locales/pl.json
@@ -2799,9 +2799,13 @@
"title": "Wymagania FFmpeg",
"notInstalled": "FFmpeg nie jest zainstalowany w tym systemie.",
"versionMismatch": "Zainstalowano FFmpeg {{version}}.",
- "requiredByPlugin": "Ta wtyczka wymaga ffmpeg. Zainstaluj go i spróbuj ponownie.",
+ "requiredByPlugin": "Możesz teraz zainstalować wtyczkę. Przed jej włączeniem lub uruchomieniem skonfiguruj zgodną wersję FFmpeg.",
"optionalDegraded": "Funkcje multimedialne tej wtyczki będą niedostępne, dopóki nie zainstalujesz ffmpeg."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg jest niedostępny. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "Wersja FFmpeg nie spełnia wymagań tej wtyczki. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/pt-BR.json b/src/shared/locales/pt-BR.json
index 1313dbd3..1a41b9d2 100644
--- a/src/shared/locales/pt-BR.json
+++ b/src/shared/locales/pt-BR.json
@@ -2778,9 +2778,13 @@
"title": "Requisito do FFmpeg",
"notInstalled": "O FFmpeg não está instalado neste sistema.",
"versionMismatch": "O FFmpeg {{version}} está instalado.",
- "requiredByPlugin": "Este plugin exige o ffmpeg. Instale-o e tente novamente.",
+ "requiredByPlugin": "Você pode instalar o plugin agora. Configure uma versão compatível do FFmpeg antes de ativá-lo ou executá-lo.",
"optionalDegraded": "Os recursos de mídia deste plugin ficarão indisponíveis até que o ffmpeg seja instalado."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "O FFmpeg não está disponível. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "A versão do FFmpeg não atende aos requisitos deste plugin. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/ro.json b/src/shared/locales/ro.json
index 4f8fa679..68ec70e3 100644
--- a/src/shared/locales/ro.json
+++ b/src/shared/locales/ro.json
@@ -1286,10 +1286,14 @@
"ffmpeg": {
"notInstalled": "FFmpeg nu este instalat pe acest sistem.",
"optionalDegraded": "Funcțiile media ale acestui modul nu vor fi disponibile până la instalarea ffmpeg.",
- "requiredByPlugin": "Acest modul necesită ffmpeg. Instalează-l și încearcă din nou.",
+ "requiredByPlugin": "Puteți instala pluginul acum. Configurați o versiune compatibilă de FFmpeg înainte de activare sau rulare.",
"title": "Cerință FFmpeg",
"versionMismatch": "Este instalat FFmpeg {{version}}."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg nu este disponibil. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "Versiunea FFmpeg nu îndeplinește cerințele acestui plugin. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"plugins": {
diff --git a/src/shared/locales/ru.json b/src/shared/locales/ru.json
index dfb85ec6..b7f91834 100644
--- a/src/shared/locales/ru.json
+++ b/src/shared/locales/ru.json
@@ -2799,9 +2799,13 @@
"title": "Требования к FFmpeg",
"notInstalled": "FFmpeg не установлен в этой системе.",
"versionMismatch": "Установлен FFmpeg {{version}}.",
- "requiredByPlugin": "Этому плагину требуется ffmpeg. Установите его и повторите попытку.",
+ "requiredByPlugin": "Плагин можно установить сейчас. Перед включением или запуском настройте совместимую версию FFmpeg.",
"optionalDegraded": "Функции работы с медиа в этом плагине будут недоступны до установки ffmpeg."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg недоступен. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "Версия FFmpeg не соответствует требованиям этого плагина. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/th.json b/src/shared/locales/th.json
index 982e005d..4cc34c23 100644
--- a/src/shared/locales/th.json
+++ b/src/shared/locales/th.json
@@ -1262,10 +1262,14 @@
"ffmpeg": {
"notInstalled": "ระบบนี้ยังไม่ได้ติดตั้ง FFmpeg",
"optionalDegraded": "ความสามารถด้านสื่อของปลั๊กอินนี้จะใช้ไม่ได้จนกว่าจะติดตั้ง ffmpeg",
- "requiredByPlugin": "ปลั๊กอินนี้ต้องใช้ ffmpeg ติดตั้งแล้วลองอีกครั้ง",
+ "requiredByPlugin": "คุณติดตั้งปลั๊กอินได้ทันที โปรดตั้งค่า FFmpeg เวอร์ชันที่รองรับก่อนเปิดใช้งานหรือเรียกใช้ปลั๊กอิน",
"title": "ข้อกำหนด FFmpeg",
"versionMismatch": "ติดตั้ง FFmpeg {{version}} แล้ว"
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "ไม่สามารถใช้ FFmpeg ได้ Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "เวอร์ชัน FFmpeg ไม่ตรงตามข้อกำหนดของปลั๊กอินนี้ Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"plugins": {
diff --git a/src/shared/locales/tr.json b/src/shared/locales/tr.json
index 0555e634..7a06a1ca 100644
--- a/src/shared/locales/tr.json
+++ b/src/shared/locales/tr.json
@@ -2757,9 +2757,13 @@
"title": "FFmpeg gereksinimi",
"notInstalled": "Bu sistemde FFmpeg yüklü değil.",
"versionMismatch": "FFmpeg {{version}} yüklü.",
- "requiredByPlugin": "Bu eklenti ffmpeg gerektirir. Yükleyip tekrar deneyin.",
+ "requiredByPlugin": "Eklentiyi şimdi yükleyebilirsiniz. Etkinleştirmeden veya çalıştırmadan önce uyumlu bir FFmpeg sürümü yapılandırın.",
"optionalDegraded": "ffmpeg yüklenene kadar bu eklentinin medya özellikleri kullanılamayacak."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg kullanılamıyor. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "FFmpeg sürümü bu eklentinin gereksinimlerini karşılamıyor. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/uk.json b/src/shared/locales/uk.json
index c191503d..314ebedb 100644
--- a/src/shared/locales/uk.json
+++ b/src/shared/locales/uk.json
@@ -1298,10 +1298,14 @@
"ffmpeg": {
"notInstalled": "FFmpeg не встановлено в цій системі.",
"optionalDegraded": "Медіафункції цього плагіна будуть недоступні, доки не буде встановлено ffmpeg.",
- "requiredByPlugin": "Для цього плагіна потрібен ffmpeg. Встановіть його й спробуйте ще раз.",
+ "requiredByPlugin": "Плагін можна встановити зараз. Перед увімкненням або запуском налаштуйте сумісну версію FFmpeg.",
"title": "Вимоги до FFmpeg",
"versionMismatch": "Встановлено FFmpeg {{version}}."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg недоступний. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "Версія FFmpeg не відповідає вимогам цього плагіна. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"plugins": {
diff --git a/src/shared/locales/vi.json b/src/shared/locales/vi.json
index d2f370fa..65772fea 100644
--- a/src/shared/locales/vi.json
+++ b/src/shared/locales/vi.json
@@ -2736,9 +2736,13 @@
"title": "Yêu cầu FFmpeg",
"notInstalled": "Chưa cài FFmpeg trên hệ thống này.",
"versionMismatch": "Đã cài FFmpeg {{version}}.",
- "requiredByPlugin": "Tiện ích này cần ffmpeg. Hãy cài đặt rồi thử lại.",
+ "requiredByPlugin": "Bạn có thể cài đặt plugin ngay. Hãy cấu hình phiên bản FFmpeg tương thích trước khi bật hoặc chạy plugin.",
"optionalDegraded": "Các tính năng đa phương tiện của tiện ích này sẽ không khả dụng cho đến khi cài ffmpeg."
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg hiện không khả dụng. Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "Phiên bản FFmpeg không đáp ứng yêu cầu của plugin này. Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {
diff --git a/src/shared/locales/zh-CN.json b/src/shared/locales/zh-CN.json
index 822d9e82..47231aef 100644
--- a/src/shared/locales/zh-CN.json
+++ b/src/shared/locales/zh-CN.json
@@ -2736,9 +2736,13 @@
"title": "FFmpeg 要求",
"notInstalled": "本机未安装 FFmpeg。",
"versionMismatch": "已安装 FFmpeg {{version}}。",
- "requiredByPlugin": "此插件必须 ffmpeg。安装后再试。",
+ "requiredByPlugin": "可以先安装插件,启用或运行前再配置兼容的 FFmpeg。",
"optionalDegraded": "此插件的媒体功能在装 ffmpeg 前不可用。"
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg 当前不可用。 请在设置 → 集成 → 媒体工具中配置 FFmpeg。",
+ "ffmpegIncompatible": "FFmpeg 版本不满足此插件的要求。 请在设置 → 集成 → 媒体工具中配置 FFmpeg。"
}
},
"bridge": {
diff --git a/src/shared/locales/zh-TW.json b/src/shared/locales/zh-TW.json
index 4052d06a..af1878bd 100644
--- a/src/shared/locales/zh-TW.json
+++ b/src/shared/locales/zh-TW.json
@@ -2309,9 +2309,13 @@
"title": "FFmpeg 需求",
"notInstalled": "此系統未安裝 FFmpeg。",
"versionMismatch": "已安裝 FFmpeg {{version}}。",
- "requiredByPlugin": "此外掛程式需要 ffmpeg。請安裝後再試一次。",
+ "requiredByPlugin": "可以先安裝外掛,啟用或執行前再設定相容的 FFmpeg。",
"optionalDegraded": "安裝 ffmpeg 前,此外掛程式的媒體功能無法使用。"
}
+ },
+ "runtime": {
+ "ffmpegUnavailable": "FFmpeg 目前無法使用。 Configure FFmpeg in Settings → Integration → Media Tools.",
+ "ffmpegIncompatible": "FFmpeg 版本不符合此外掛的需求。 Configure FFmpeg in Settings → Integration → Media Tools."
}
},
"bridge": {