Repository navigation
feat(price): set a manual value on Discogs albums - #66
Merged
Jeanball merged 4 commits intoNov 25, 2026
Merged
Conversation
updateDiscogsAlbum ignored `value`, so only manually added albums could carry a hand-entered value. Records Discogs has no price for (test pressings, rarities) therefore stayed out of the totals. It now sets manualValue on the user's copy like the manual endpoint does: blank clears it, a malformed amount answers 400, and restoring the album leaves it alone. Value functions already prefer manualValue, so totals and the value history follow without further changes.
Show the value field in the album form for Discogs albums too, with a hint that it replaces the Discogs price, and label a hand-entered value as manual on the album page. New string in all 7 locales.
A manual value wins over the Discogs price, while the price sync keeps refreshing the latter underneath. Show it on the album page so a value that has gone stale can be spotted, and cleared to get the Discogs price back. New string in all 7 locales.
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
A record Discogs has no price for (a test pressing, a rarity) counts as 0 in the totals, and since 1.16.0 only manually added albums can carry a value entered by hand. This lets a Discogs album carry one too. The value functions already prefer
manualValue, so the totals and the value history follow without further changes.Changes
feat(price): accept a manual value on Discogs albums:updateDiscogsAlbumnow readsvalueand setsmanualValueon the user's copy, like the manual endpoint does. Blank clears it, a malformed amount answers 400, and it is left alone when the request doesn't send it. It is item data, not a Discogs override, so "restore Discogs data" doesn't remove it.feat(price): edit the value of a Discogs album: the album form shows the "Value (USD)" field for Discogs albums too, with a hint that it replaces the Discogs price, and the album page labels a hand-entered value as "Manual value". One new string, in all 7 locales.feat(price): show the Discogs price next to a manual value: a manual value wins over the Discogs price while the price sync keeps refreshing the latter, so a value can go stale. The album page shows "Manual value · Discogs price: …" when Discogs has a price, and clearing the value brings it back. One new string, in all 7 locales.Same as for manual albums: the amount is entered and stored in USD, whatever the display currency. A currency-aware input would be a separate change that also touches the manual form; happy to do it if you want it.
How it was verified
cd backend && npm run build && npm run test:run: pass, 195 tests. 8 new tests incollection.discogsAlbum.test.ts(saves and rounds, clears on blank, left alone when not sent, rejectsabc,-5andInfinitywithout saving, survives a restore); the 5 that cover the new behaviour fail without the change.cd frontend && npm run lint && npm run test:run && npm run build: 0 lint errors, 169 tests pass. 6 new tests (field and hint on a Discogs album, saved value shown and sent blank to clear it, no Discogs hint on a manual album, "Manual value" label, Discogs price beside a manual value, none when Discogs has no price); they fail without the change.Checked by hand on a local dev database (about 1,500 records):
priceCache: null) and entered 15: the album page shows $15.00 labelled "Manual value", and the database hasmanualValue: 15withlocallyModifiedstill false.Not covered: phone width not checked.
Checklist
develop(notmain)fix(discogs): …CHANGELOG.mdunder## [Unreleased]npm run lint,npm run test:runandnpm run buildpassnpm run buildpassesbackend/src/scripts/migration-runner.ts(none needed: optional field that already exists)