Add library code lookup, reviews API, and album update#212
Draft
jakebromberg wants to merge 4 commits intomainfrom
Draft
Add library code lookup, reviews API, and album update#212jakebromberg wants to merge 4 commits intomainfrom
jakebromberg wants to merge 4 commits intomainfrom
Conversation
added 4 commits
February 28, 2026 10:09
Implement the library code lookup TODO at library.controller.ts:105-108: - lookupByLibraryCode() queries library_artist_view by code_letters, code_artist_number, with optional code_number and genre_name filters Add reviews API (GET/PUT /library/reviews): - getReviewByAlbumId() returns review for an album - upsertReview() uses onConflictDoUpdate on album_id unique constraint Add album update endpoint (PATCH /library): - updateAlbumFields() updates label and/or album_title on a library row All endpoints use existing catalog:read/catalog:write permissions. Includes unit tests for all new service functions.
The code lookup endpoint is now implemented via lookupByLibraryCode(), so the test should expect 200 with valid album data instead of 501. Replaces the single 501 stub test with three tests: successful lookup by code_letters + code_artist_number, narrowed lookup with code_number, and empty result for non-existent codes.
Use seed data code_letters 'BU' / code_artist_number 60 (Built to Spill) instead of 'BUI' / 1 which doesn't exist in the CI database. Run Prettier on files modified in the previous commit.
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.
Summary
library.controller.ts:105-108-- querylibrary_artist_viewbycode_lettersandcode_artist_number, with optionalcode_numberandgenre_namefiltersGET /library/reviews?album_id=123andPUT /library/reviewswith upsert semanticsPATCH /libraryfor updating label and album_title fieldscatalog:read/catalog:writepermissionsPart of the library-scanner project. See WXYC/library-scanner for the iPhone app that consumes these endpoints.
Test plan
lookupByLibraryCode()(4 tests)updateAlbumFields()(3 tests)getReviewByAlbumId()andupsertReview()(5 tests)