Migrate model filesystem helpers to `pathlib.Path`
Author: snejusCreated Sep 1, 2026Updated Sep 29, 2026
Labelscore
Part of: #1409
Depends on: the library-directory Path migration.
Problem
Item and album helper methods already describe filesystem behavior, but some still accept or pass byte paths internally. This spreads path conversion through model operations such as reading, writing, moving, destination calculation, playlist generation, and art handling.
Expected behavior
- Model helper methods that perform filesystem work use
Pathinputs and outputs. Item.from_path,Item.read,Item.write,Item.destination,Item.move,Item.move_file, album art helpers, and related utility-facing calls operate onPath.- Event payloads for moved, copied, linked, and art-updated models use
Pathfor source and destination paths. - Tests assert
Pathbehavior throughfilepathandart_filepath. - Byte storage remains an internal compatibility detail until the SQL boundary issue lands.
Suggested fix
Convert the model helper surface before changing the central database type. This lets model behavior become Path-native while keeping existing storage semantics available for compatibility.
Acceptance criteria
- Public model filesystem helpers accept and return
Pathwhere practical. - Existing file move, copy, link, write, art, playlist, and destination tests pass.
- Remaining byte access is explicit and tied to persistence compatibility.
poe testandpoe lintpass with coverage at or above 80%.
Source: beetbox/beets