# Tasks — Jellyfin service-registry migration (completion)

**Change:** `jellyfin-service-registry`
**Phase:** tasks
**Date:** 2026-06-23

## Review workload forecast

| Field | Value |
|-------|-------|
| Estimated changed lines | ~250–350 |
| Chained PRs recommended | No (single PR) |
| Chain strategy | n/a |

## Slice 1: Backend cleanup

**Goal:** Remove Jellyfin and dead path-mapping fields from machine config.

- [ ] **1.1 Drop `jellyfin` from default machine services**
  - Files: `backend/src/media_library_viewer_api/services/settings_store.py`
  - Lines: ~5
  - Details: Change `DEFAULT_SERVICES = ["monitoring", "files", "jellyfin"]` to `["monitoring", "files"]`. Update all fallback/default service lists.

- [ ] **1.2 Remove `media_root` and `path_prefix` machine fields**
  - Files: `backend/src/media_library_viewer_api/services/settings_store.py`
  - Lines: ~40
  - Details: Remove from machine table schema (if present), `_normalize_machine_payload`, `_row_to_machine`, default seeding, and any serialization helpers.

- [ ] **1.3 Review/delete `path_utils.py`**
  - Files: `backend/src/media_library_viewer_api/path_utils.py`, `backend/tests/test_path_utils.py`
  - Lines: ~-120 if deleted, else ~10 to confirm callers
  - Details: Check if any live router still imports the helpers. If not, delete module and tests.

- [ ] **1.4 Update backend tests**
  - Files: `backend/tests/test_api.py`, `backend/tests/test_widgets.py`, others as needed
  - Lines: ~20
  - Details: Remove `media_root`/`path_prefix` from machine fixtures.

- [ ] **1.5 Verify backend**
  - Run: `cd backend && .venv/bin/ruff check . && PYTHONPATH=src .venv/bin/python -m pytest`

## Slice 2: Frontend cleanup

**Goal:** Remove dead machine fields and the Jellyfin service option from Settings.

- [ ] **2.1 Update types**
  - Files: `frontend/src/types/index.ts`
  - Lines: ~10
  - Details: Remove `media_root` and `path_prefix` from `MonitoringMachine` and `MonitoringMachineInput`.

- [ ] **2.2 Update Settings form**
  - Files: `frontend/src/pages/Settings.tsx`
  - Lines: ~60
  - Details: Remove `media_root` and `path_prefix` inputs, remove `jellyfin` from the services multi-select options, update `emptyMachine()` and edit reset logic.

- [ ] **2.3 Update frontend tests**
  - Files: `frontend/src/pages/__tests__/Settings.test.tsx` if it exists, or other fixtures
  - Lines: ~15
  - Details: Remove fields from mock machines.

- [ ] **2.4 Verify frontend**
  - Run: `cd frontend && npm run lint && npm run build && npm run test`

## Slice 3: Docs + changelog

**Goal:** Document the completed migration and removed fields.

- [ ] **3.1 Update REQUIREMENTS.md**
  - Files: `docs/REQUIREMENTS.md`
  - Lines: ~10
  - Details: Remove references to machine-level `media_root`/`path_prefix` and Jellyfin service tagging.

- [ ] **3.2 Update CHANGELOG.md**
  - Files: `CHANGELOG.md`
  - Lines: ~10
  - Details: Add a breaking/changed note: machine config no longer includes `media_root`, `path_prefix`, or `jellyfin` in `services`; Jellyfin is configured exclusively via Services.

- [ ] **3.3 Commit**
  - Commit message: `refactor(settings): complete Jellyfin migration onto service registry`

## Acceptance

- `grep -R "media_root\|path_prefix" backend/src frontend/src` returns only `path_utils.py` and tests if retained, or nothing if deleted.
- `jellyfin` is not offered as a machine service in the Settings UI.
- Backend `pytest` and frontend `npm run lint/build/test` all pass.
- Docs and changelog updated.
