Skip to content

feat(price): set a manual value on Discogs albums - #66

Merged
Jeanball merged 4 commits into
Jeanball:developfrom
npozs77:feat/manual-value-discogs-albums
Nov 25, 2026
Merged

Jeanball merged 4 commits into
Jeanball:developfrom
npozs77:feat/manual-value-discogs-albums

Conversation

@npozs77

@npozs77 npozs77 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

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: updateDiscogsAlbum now reads value and sets manualValue on 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 in collection.discogsAlbum.test.ts (saves and rounds, clears on blank, left alone when not sent, rejects abc, -5 and Infinity without 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):

  • Edited a Discogs album with no price (priceCache: null) and entered 15: the album page shows $15.00 labelled "Manual value", and the database has manualValue: 15 with locallyModified still false.
  • Added 200 on a second unpriced record: the total value on the stats page went up.
  • The Discogs price beside a manual value (third commit) was also looked at in the browser.

Not covered: phone width not checked.

Checklist

  • Targets develop (not main)
  • Title follows Conventional Commits with a scope, e.g. fix(discogs): …
  • Line added to CHANGELOG.md under ## [Unreleased]
  • Frontend: npm run lint, npm run test:run and npm run build pass
  • Backend: npm run build passes
  • New UI strings added to all locales
  • Data changes come with a migration in backend/src/scripts/migration-runner.ts (none needed: optional field that already exists)
  • Screenshots attached for UI changes

npozs77 and others added 4 commits November 19, 2026 13:10
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.
@Jeanball
Jeanball merged commit 62aeb3d into Jeanball:develop Nov 25, 2026
5 checks passed
@npozs77
npozs77 deleted the feat/manual-value-discogs-albums branch November 25, 2026 08:29
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.

2 participants