Make `Library.directory` and music-directory context Path-based
Author: snejusCreated Sep 1, 2026Updated Sep 29, 2026
Labelscore
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.directoryis represented asPathin runtime code.- The music-directory context exposes
Pathvalues to callers. - Code that checks whether a path is inside the library works with
Pathdirectly. - 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
Pathin runtime code. - Existing tests for library setup, update, permissions, unimported, and path containment still pass.
poe testandpoe lintpass with coverage at or above 80%.
Source: beetbox/beets