Skip to content

fix(jellyfin): inline-validate the off-media config folder field (like Plex)#275

Merged
stevezau merged 1 commit into
devfrom
fix/jellyfin-config-folder-inline-validation
Jun 30, 2026
Merged

fix(jellyfin): inline-validate the off-media config folder field (like Plex)#275
stevezau merged 1 commit into
devfrom
fix/jellyfin-config-folder-inline-validation

Conversation

@stevezau

Copy link
Copy Markdown
Owner

The off-media "Jellyfin config folder" settings field had no inline validation — only the Setup Health tab checked it (#274). The Plex field validates live; this adds the Jellyfin equivalent so the field shows valid/invalid as you type (exactly what was expected when you flagged it).

What changed

  • New endpoint POST /api/settings/validate-jellyfin-config-folder (mirrors validate-plex-config-folder): returns {exists, valid_jellyfin_structure, writable, detail, error}. Not restricted to a fixed root (Jellyfin config is an arbitrary admin mount); admin-only, read-only stat, null-byte guarded.
  • Shared logic: extracted looks_like_jellyfin_config_dir() so the field validator and the Setup Health probe use identical checks (can never disagree).
  • Frontend: the field is wired to the live validator (input + browse-pick + on-open when off-media is on) → shows "Valid Jellyfin config folder" / a clear error. Added the feedback spans + has-validation to the input-group so messages render.

Tests

valid-via-data/, valid-via-plugins/, not-found, wrong-folder (media dir) → error, empty → neutral, valid-but-read-only → flagged. Architecture Review run — no HIGH; the MED (read-only branch coverage) fixed before commit.

🤖 Generated with Claude Code

…e Plex)

The off-media "Jellyfin config folder" settings field had no inline validation
— only the Setup Health tab checked it (#274). The Plex config-folder field
validates live via /api/settings/validate-plex-config-folder; this adds the
Jellyfin equivalent so the field shows valid/invalid as you type.

- New POST /api/settings/validate-jellyfin-config-folder (mirrors the Plex
  one): {exists, valid_jellyfin_structure, writable, detail, error}. Unlike
  Plex it isn't restricted to a fixed root (Jellyfin config is an arbitrary
  admin mount); admin-only, read-only stat, null-byte guarded.
- Extracted looks_like_jellyfin_config_dir()/jellyfin_config_data_marker()
  into output/jellyfin_trickplay.py and pointed BOTH the Setup Health probe
  and the new endpoint at them, so the field validator and the health check
  can never disagree.
- servers.js: the editJellyfinConfigFolder field is wired to the live
  validator (bound once; validates on input, on browse-pick, and on open when
  off-media is on) and routed to the new endpoint with a "Valid Jellyfin
  config folder" message. servers.html: added the invalid/valid feedback spans
  + has-validation to the field's input-group so messages render.

Tests: endpoint valid-via-data, valid-via-plugins, not-found, wrong-folder
(media dir) -> error, empty -> neutral, valid-but-read-only -> flagged.
Architecture Review run; the MED (read-only branch coverage) fixed before commit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YC1Z1JFBVJ5xKi5YAqYKfc
@stevezau stevezau merged commit 0269e8d into dev Jun 30, 2026
12 checks passed
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.00%. Comparing base (8ae5d02) to head (03709ce).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
media_preview_generator/web/routes/api_settings.py 95.45% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #275   +/-   ##
=======================================
  Coverage   83.99%   84.00%           
=======================================
  Files          89       89           
  Lines       19640    19670   +30     
=======================================
+ Hits        16496    16523   +27     
- Misses       3144     3147    +3     
Files with missing lines Coverage Δ
...dia_preview_generator/output/jellyfin_trickplay.py 90.75% <100.00%> (+0.44%) ⬆️
media_preview_generator/servers/jellyfin.py 83.26% <100.00%> (ø)
media_preview_generator/web/routes/api_settings.py 79.83% <95.45%> (+0.60%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stevezau stevezau deleted the fix/jellyfin-config-folder-inline-validation branch June 30, 2026 01:12
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.

1 participant