Skip to content

Add shelf codes to library search results - #7

Merged
rybesh merged 1 commit into
mainfrom
library-search-shelf-codes
Jul 11, 2026
Merged

rybesh merged 1 commit into
mainfrom
library-search-shelf-codes

Conversation

@rybesh

@rybesh rybesh commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

What

Human-readable library search output now includes a SHELF column with each album's physical filing location, e.g.:

ID     SHELF               ARTIST      ALBUM                  FORMAT
53948  Electronic AP 2/2   Aphex Twin  I Care Because You Do  cd
60375  Rock AP 8/1         Apex        Love not far removed…  vinyl

A shelf code is {genre} {code_letters} {code_artist_number}/{code_number} — e.g. "Jazz DA 11/4" is the 4th release by the 11th artist filed under "DA" in the Jazz section.

How

  • Add GenreName (genre_name) to the Album struct.
  • Add Album.ShelfCode(), which composes the code from genre + code letters + artist/release numbers, falls back to a bare code when the genre is absent, and returns "" when the album has no code letters (no shelf assignment).
  • Add the SHELF column to the library search table projection.

--json output is unchanged — genre_name was already present in the raw server response and continues to pass through byte-for-byte.

Tests

Red-green TDD: internal/api/album_test.go covers ShelfCode() (full code, missing genre, missing code letters); a cmd test asserts the search table surfaces the shelf code. Both were watched fail before the implementation. go vet ./... and go test ./... pass.

🤖 Generated with Claude Code

Human-readable `library search` output now includes a SHELF column with
the album's physical filing location, e.g. "Jazz DA 11/4" (the 4th release
by the 11th artist filed under "DA" in the Jazz section).

Adds GenreName (genre_name) to the Album struct and an Album.ShelfCode()
method that composes genre + code_letters + code_artist_number/code_number,
falling back to a bare code when genre is absent and to "" when the album
has no code letters. --json passthrough is unchanged; genre_name was
already present in the raw server response.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rybesh
rybesh merged commit 4a32a5f into main Jul 11, 2026
1 check passed
@rybesh
rybesh deleted the library-search-shelf-codes branch July 11, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant