v0.17.4-0009: Clear Emby Logos feature (GH #475, bd-v9tp7)#478
Merged
Conversation
Emby caches channel logos and keeps serving a stale image even after the
logo changes in Dispatcharr. Replicate Channel Identifiarr's clear-logos
feature, reusing ECM's existing Emby connection (saved emby_base_url +
emby_api_key, X-Emby-Token auth) — no new credentials, no AuthenticateByName
login. Deleting the cached image makes Emby re-download the logo from its
source on next channel access.
Backend:
- EmbyClient.get_livetv_channels() (auth gate) + delete_item_image(id, type)
with a Primary/LogoLight/LogoLightColor image-type whitelist.
- New admin-gated routers/emby.py: POST /api/emby/clear-logos returns
202 + {job_id} and runs a supervised background task (full-lineup sweep
would exceed the 30s request timeout; same 202+poll pattern as bulk-commit
bd-ggxks), plus GET /api/emby/clear-logos/{job_id} to poll. Clears all
Live TV channels (optional channel_ids filter for a future per-group UI),
per-channel resilient, validates Emby is configured.
- Progress surfaced through the notification system like stream probe: the
job emits a task_clear_emby_logos progress notification (create →
rate-limited updates → finalize success/warning) rendered live by the
NotificationCenter via a new 'clearing' active status.
Frontend:
- services/api.ts: clearEmbyLogos + getClearEmbyLogosStatus + EMBY_LOGO_TYPES.
- Settings → Integrations → Emby: "Clear Cached Logos" block with per-type
checkboxes (default all three), fire-and-forget button gated on a saved key.
- NotificationCenter: add 'clearing' to the progress status union + active list.
MCP:
- New clear_emby_logos tool (202+poll), endpoint contract, registration.
Tests: 33 backend (client + router incl. notification lifecycle), 6 MCP tool,
129 MCP/backend contract, 76 frontend (incl. clear-logos UI). Bumps the three
version touchpoints 0.17.4-0008 -> 0.17.4-0009 and adds the CHANGELOG entry.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…pi const Two CI failures from the clear-logos change: - Backend test_router_registration::test_used_tags_mostly_covered: the new routers/emby.py added a tags=["Emby"] tag not present in main.py tags_metadata, pushing the missing-tag set from 3 to 4 (>3 cap). Declare the Emby tag in tags_metadata. - Frontend Plex/Jellyfin section tests crashed rendering the Integrations page: SettingsTab read api.EMBY_LOGO_TYPES at render time, but those test files mock the api module without that export, so .map() hit undefined. Define EMBY_LOGO_TYPES as a local module constant in SettingsTab instead (api.clearEmbyLogos stays — it's call-time only). The api export remains for the API-layer types/MCP parity. Verified: full frontend suite 1570 passed; tsc 0; eslint 0; backend router-registration tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GH #475 (Critical): Emby caches channel logos and keeps serving a stale image even after the logo changes upstream in Dispatcharr, with no way to force a refresh. Channel Identifiarr has a "clear logos" function that deletes the cached image so Emby re-fetches it; this replicates that.
Approach
Reuses ECM's existing Emby connectivity — the saved
emby_base_url+emby_api_keywithX-Emby-Tokenauth (what the resolver/cache already use). A static Emby API key authenticates bothGET /LiveTv/Channels(enumerate) and per-channelDELETE /Items/{id}/Images/{type}(clear), so no new credentials and noAuthenticateByNameusername/password login (simpler than CI). Deleting the cached image makes Emby re-download the logo from its source on next channel access.What's included
Backend
EmbyClient.get_livetv_channels()(the auth gate — a bad key fails here before any delete) anddelete_item_image(id, type), with aPrimary/LogoLight/LogoLightColorimage-type whitelist.routers/emby.py:POST /api/emby/clear-logos→ 202 + {job_id} running a supervised background task (a full-lineup sweep — hundreds of channels × up to 3 types — would exceed the 30sECM_REQUEST_TIMEOUT_SECONDSmiddleware; same 202+poll pattern as bulk-commit, bd-ggxks), plusGET /api/emby/clear-logos/{job_id}. Clears all Live TV channels (accepts an optionalchannel_idsfilter for a future per-group UI — PO decision), per-channel resilient, validates Emby is configured (400 otherwise) and the image types (400 on unknown).Progress via the notification system, like stream probe (PO decision)
task_clear_emby_logosprogress notification (create → rate-limited updates → finalize success/warning), rendered live by the NotificationCenter — progress bar, deleted/skipped/error counts, current channel name — driven by a newclearingactive status.Frontend
services/api.ts:clearEmbyLogos+getClearEmbyLogosStatus+EMBY_LOGO_TYPES.NotificationCenter:clearingadded to the progress status union + active list.MCP
clear_emby_logostool (202+poll), endpoint contract + registration.Tests
tsc0,eslint0.Pre-existing unrelated failures in
test_alert_methods.py(6 SMTP cases — unregisteredsmtptype in the local test registry) are environment-specific and documented in PR #474; not touched here.Versioning
All three touchpoints bumped
0.17.4-0008 → 0.17.4-0009(consistency check passes); CHANGELOG[Unreleased] → Addedentry.Closes GH #475. bd-v9tp7.
🤖 Generated with Claude Code