Skip to content

fix(discover): fetch upcoming releases with one search per style - #55

Merged
Jeanball merged 4 commits into
Jeanball:developfrom
npozs77:fix/discover-fetch-by-style
Nov 25, 2026
Merged

Jeanball merged 4 commits into
Jeanball:developfrom
npozs77:fix/discover-fetch-by-style

Conversation

@npozs77

@npozs77 npozs77 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

"Refresh Upcoming Releases" fails with a 400 because it fetched every release group in the date window and only matched styles afterwards, which runs into MusicBrainz's 500-result cap. It now runs one search per wanted style. This also carries the two notes from your comment on #50: members can follow styles themselves, and a newly followed style is fetched right away.

Fixes #50

Rebased onto develop at v1.16.2 now that #54 has merged, so the PR is just these three commits.

Changes

  • fix(discover): fetch upcoming releases with one search per style: one artisttag:"<style>" search per style, styles lowercased and quoted ("hard rock"), Album/EP and no-year-only filters kept. A style past 500 results is cut to the first 500 with a logged warning instead of failing. A style is fetched if at least one member wants it (in their collection or followed, and not excluded by that member); discoverExcludedStyles still filters the display per member. The artist-tag lookup is gone (the search already scopes by tag). UpcomingRelease.style is now stored lowercase, so the display lookup is case-insensitive and the task deletes rows for styles nobody wants, which also clears the old capitalised rows on the first run. Adds preferences.discoverIncludedStyles (the controller validates it, max 50).
  • feat(discover): follow styles that are not in your collection: the genres dropdown has an input with suggestions to follow a style; unticking a followed style unfollows it. When the list is empty, Discover shows chips of common styles to follow. Followed styles also count for the concerts matching. 4 new strings in all 7 locales (now including it).
  • feat(discover): fetch a newly followed style right away: saving a newly followed (or un-excluded) style queues a fetch for it, debounced (3 s), skipped when already queued or fetched in the last 7 days, and run through the same one-at-a-time lock as the weekly task so MusicBrainz's rate limit holds. Failures are logged and left to the weekly task.

How it was verified

  • cd backend && npm run build && npm run test:run: 202 tests pass (new: query builder, style resolution, queue debounce/skip/serialise).
  • cd frontend && npm run lint && npm run test:run && npm run build: 0 lint errors, 162 tests pass.
  • Local dev against a real Mongo and the real MusicBrainz, with a 30-style collection: all styles fetched without the 400, e.g. punk 42 found / 28 stored, one 503 on parody retried then skipped with a warning. Following jazz (not in the collection) fetched it right after Save and its releases showed on Discover.

Not covered: a style over the 500-result cap (none of my styles reaches it; the cut is only exercised by reading the code), and the weekly task's own end-to-end run after this change.

Release cards now show the style lowercase (e.g. hard rock), since that is how it is stored.

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 6 locales (frontend/src/locales/*/translation.json)
  • Data changes come with a migration in backend/src/scripts/migration-runner.ts (not needed: stale rows are cleaned up by the task itself)
  • Screenshots attached for UI changes

@npozs77
npozs77 force-pushed the fix/discover-fetch-by-style branch from 0a01752 to f59e137 Compare November 18, 2026 07:36
@npozs77
npozs77 marked this pull request as ready for review November 18, 2026 07:40
@npozs77

npozs77 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Marking this ready for review. #54 has merged, so I rebased the branch onto develop at v1.16.2 (the conflicts were in the preferences controller, collection.service.ts and the changelog) and added the four new strings to the Italian locale. Backend build and 202 tests pass, and frontend lint, 162 tests and build pass. The PR is now just the three commits listed in the description.

@Jeanball it should be ready to merge when you have a moment.

@Jeanball
Jeanball merged commit cf2f62d into Jeanball:develop Nov 25, 2026
5 checks passed
@npozs77
npozs77 deleted the fix/discover-fetch-by-style 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.

Refresh Upcoming Releases fails with HTTP 400: how should the feature scope its MusicBrainz fetch?

2 participants