Make `Library.directory` and music-directory context Path-based
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 2.1k
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 31
Description
Part of: #1409
Depends on: the artwork/media path migration.
## Problem
The library root is still a mixed path boundary. `Library.directory`, the music-directory context, and callers that compare paths against the library root still need byte or string conversions, which makes later model and query migration harder to review safely.
## Expected behavior
- `Library.directory` is represented as `Path` in runtime code.
- The music-directory context exposes `Path` values to callers.
- Code that checks whether a path is inside the library works with `Path` directly.
- Existing database storage and configuration behavior are unchanged.
- Plugins and UI code that only need the library root stop encoding or decoding it.
## Suggested fix
Migrate the library directory contract first, then update direct callers in importer tasks, UI setup, update handling, and plugins that compare against or join with the library root.
## Acceptance criteria
- Library directory values are `Path` in runtime code.
- Existing tests for library setup, update, permissions, unimported, and path containment still pass.
- `poe test` and `poe lint` pass with coverage at or above 80%.
Contributor guide
Research direction
Start by locating Library.directory and the music-directory context, then trace direct callers in importer tasks, UI setup, update handling, and plugins that compare or join paths with the library root. Run the existing library setup, update, permissions, unimported, and path-containment tests first; done means runtime values use Path, database and configuration behavior remain unchanged, and poe test plus poe lint pass with at least 80% coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100