Repository navigation
Add shelf codes to library search results - #7
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Human-readable
library searchoutput now includes a SHELF column with each album's physical filing location, e.g.: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
GenreName(genre_name) to theAlbumstruct.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).SHELFcolumn to thelibrary searchtable projection.--jsonoutput is unchanged —genre_namewas already present in the raw server response and continues to pass through byte-for-byte.Tests
Red-green TDD:
internal/api/album_test.gocoversShelfCode()(full code, missing genre, missing code letters); acmdtest asserts the search table surfaces the shelf code. Both were watched fail before the implementation.go vet ./...andgo test ./...pass.🤖 Generated with Claude Code