webhook: PascalCase payload + ItemAdded only, switch ✓✓ signal to ffprobe
Build and Push Docker Image / build (push) Successful in 1m56s

monitoring the mqtt broker revealed two bugs and one design dead-end:

1. the jellyfin-plugin-webhook publishes pascalcase fields
   (NotificationType, ItemId, ItemType) and we were reading camelcase
   (event, itemId, itemType). every real payload was rejected by the
   first guard — the mqtt path never ingested anything.

2. the plugin has no ItemUpdated / Library.* notifications. file
   rewrites on existing items produce zero broker traffic (observed:
   transcode + manual refresh metadata + 'recently added' appearance
   → no mqtt messages). ✓✓ via webhook is structurally impossible.

fix the webhook path so brand-new library items actually get ingested,
and narrow ACCEPTED_EVENTS to just 'ItemAdded' (the only library-side
event the plugin emits).

move the ✓✓ signal from webhook-corroboration to post-execute ffprobe
via the existing verifyDesiredState helper: after ffmpeg returns 0 we
probe the output file ourselves and flip verified=1 on match. the
preflight-skipped path sets verified=1 too. renamed the db column
webhook_verified → verified (via idempotent RENAME COLUMN migration)
since the signal is no longer webhook-sourced, and updated the Done
column tooltip to reflect that ffprobe is doing the verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-14 17:27:22 +02:00
parent 9cdc054c4b
commit d05e037bbc
11 changed files with 94 additions and 60 deletions
+5 -5
View File
@@ -70,11 +70,11 @@ CREATE TABLE IF NOT EXISTS review_plans (
subs_extracted INTEGER NOT NULL DEFAULT 0,
notes TEXT,
reviewed_at TEXT,
-- Jellyfin has independently re-probed the file and the fresh analysis
-- still says is_noop=1. Set on initial scan for items that never needed
-- work, or on a post-execute webhook that corroborates the on-disk state.
-- Surfaces as the second checkmark on the Done column.
webhook_verified INTEGER NOT NULL DEFAULT 0,
-- An independent post-hoc check has confirmed the on-disk file matches
-- the plan: either the analyzer saw is_noop=1 on first scan, or after
-- a job completed we ffprobed the output file and it agreed with the
-- kept/removed stream decisions. Surfaces as the ✓✓ in the Done column.
verified INTEGER NOT NULL DEFAULT 0,
created_at TEXT NOT NULL DEFAULT (datetime('now'))
);