#6967·beets

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.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%.