Skip to content

feat(jellyfin): start polling fallback with the bot and add dashboard toggle - #139

Open
kylepitcock wants to merge 3 commits into
openVESSL:devfrom
kylepitcock:feat/jellyfin-polling
Open

kylepitcock wants to merge 3 commits into
openVESSL:devfrom
kylepitcock:feat/jellyfin-polling

Conversation

@kylepitcock

Copy link
Copy Markdown

Summary

  • The Jellyfin poller (jellyfinPoller.js) existed and app.js imported it, but nothing ever started it, so JELLYFIN_POLLING_ENABLED had no effect. The bot now starts it once it logs in.
  • Adds a Poll Jellyfin for new items checkbox to the dashboard's Jellyfin settings (JELLYFIN_POLLING_ENABLED). Saving applies it immediately by restarting the poller, without a full bot restart.
  • The poller is now stopped before a bot restart, so it no longer keeps a reference to a destroyed Discord client.
  • The webhook handler records real items in the shared seen-items store (deduplicator.checkAndRecord) so the poller doesn't announce an item the webhook already announced. This only records; it never skips a webhook, and test/batch notifications are ignored.

Why

Webhook delivery can silently fail or arrive with an empty body (observed with Jellyfin 12.1.0, where the webhook plugin sent content-length: 0). Polling reads from Jellyfin's API, so new items still get announced within the polling interval (5 minutes by default, JELLYFIN_POLLING_INTERVAL).

Notes

  • Polling requires the Jellyfin URL, API key and Server ID; it logs an error and doesn't start without them.
  • Items already in seen-items (including those marked by the library seed) are not announced by polling.
  • New locale strings are only in en.json and the template.
  • Only syntax-checked (node --check); not tested against a live Jellyfin server.

🤖 Generated with Claude Code

@retardgerman
retardgerman changed the base branch from main to dev October 23, 2026 15:27
kylepitcock and others added 2 commits October 23, 2026 13:22
The poller existed but was never started. Start it from the bot's ready
handler when JELLYFIN_POLLING_ENABLED=true, and record webhook-delivered
items in the shared seen-items store so polling does not re-announce them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds JELLYFIN_POLLING_ENABLED to the Jellyfin settings. Saving applies the
change immediately by restarting the poller, and the poller is stopped
before a bot restart so it does not keep a destroyed Discord client.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kylepitcock
kylepitcock force-pushed the feat/jellyfin-polling branch from 4e6f15f to 3d0d939 Compare October 23, 2026 17:23
@retardgerman

Copy link
Copy Markdown
Contributor

Thanks for digging into this. The poller not being started isn't an oversight though: it was deliberately switched off in favour of webhooks a while ago, which is why the code is still there but unused. Before bringing it back I'd want to understand the empty-body issue with Jellyfin 12.1.0 better, since fixing webhook delivery would be preferable to running both.

One technical concern if we do go this way: the webhook records episodes under the series TMDB ID (SeriesProvider_tmdb), while the poller builds its identity key from the Jellyfin API shape, which only has SeriesId. The two keys differ for the same episode, so the seen-items record from the webhook won't stop the poller. The sentNotifications check probably catches it, but that would need a live test.

Could you open an issue with the Jellyfin 12.1.0 webhook details (plugin version, logs) so we can look at the root cause first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants