Skip to content

taxis: lock canonical music template + add Release Type token #158

@forkwright

Description

@forkwright

Context

The current `default_template(MediaType::Music)` produces *arr-style paths:
`{Artist Name}/{Album Title} ({Year})/{Track Number:00} - {Track Title}.{Extension}`

The canonical layout uses square-bracket year prefixes and explicit release-type tagging so EPs, singles, lives, comps, and OSTs are visible at the directory level.

What

  1. Add `Release Type` token to the music token list in `crates/taxis/src/import/template.rs` (`valid_tokens` for `MediaType::Music`).
  2. Update `default_template(MediaType::Music)` to:
    `{Artist Name}/[{Year}] {Release Type} {Album Title}/{Disc Number:00}-{Track Number:00} - {Track Title}.{Extension}`
  3. Implement smart `{Release Type}` suppression: when `type=album`, the token resolves to empty AND any adjacent literal brackets/spaces are also dropped (so studio albums get `[2020] Elisabeth/` not `[2020] Elisabeth/` or `[2020] [] Elisabeth/`).
  4. Type values: `album` (suppressed), `ep`, `single`, `live`, `compilation`, `soundtrack` — render as `[EP]`, `[Single]`, `[Live]`, `[Comp]`, `[OST]` in the path.
  5. Resolve `Release Type` from `music_release_groups.primary_type` and `secondary_types`:
    • `primary=Album` AND no `Live`/`Compilation`/`Soundtrack` secondary → `album`
    • `primary=EP` → `ep`
    • `primary=Single` → `single`
    • secondary contains `Live` → `live`
    • secondary contains `Compilation` → `compilation`
    • secondary contains `Soundtrack` → `soundtrack`

Files

  • `crates/taxis/src/import/template.rs`
  • Tests in same file

Acceptance

  • Token added to `valid_tokens(MediaType::Music)`
  • Default template updated
  • Smart suppression: studio album test asserts `[2020] Elisabeth/01-01 - Title.flac` (no double brackets, no orphan spaces)
  • EP test asserts `[2019] [EP] DeAnn/01-01 - Title.flac`
  • Live, single, compilation, soundtrack tests
  • Existing music template test updated to match new canonical

Reference

Migration plan: discussed in chat session 2026-04-09. Worked example produced by the one-shot Python migration script at `~/menos-ops/scratch/migrate-music-canonical.py` against `/nas/media/music/Zach Bryan/`.

Depends on the canonical layout spec (issue: `docs: canonical filesystem layout spec`).

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureSystem design and structural decisionsenhancementNew feature or requeststorage-canonicalCanonical filesystem storage layout work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions