Repository navigation
fix(discover): fetch upcoming releases with one search per style - #55
Merged
Merged
Conversation
npozs77
force-pushed
the
fix/discover-fetch-by-style
branch
from
October 28, 2026 17:52
4dff6cd to
0a01752
Compare
npozs77
force-pushed
the
fix/discover-fetch-by-style
branch
from
November 18, 2026 07:36
0a01752 to
f59e137
Compare
npozs77
marked this pull request as ready for review
November 18, 2026 07:40
Contributor
Author
|
Marking this ready for review. #54 has merged, so I rebased the branch onto @Jeanball it should be ready to merge when you have a moment. |
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
"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
Changes
fix(discover): fetch upcoming releases with one search per style: oneartisttag:"<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);discoverExcludedStylesstill filters the display per member. The artist-tag lookup is gone (the search already scopes by tag).UpcomingRelease.styleis 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. Addspreferences.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 includingit).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.punk42 found / 28 stored, one503onparodyretried then skipped with a warning. Followingjazz(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
develop(notmain)fix(discogs): …CHANGELOG.mdunder## [Unreleased]npm run lint,npm run test:runandnpm run buildpassnpm run buildpassesfrontend/src/locales/*/translation.json)backend/src/scripts/migration-runner.ts(not needed: stale rows are cleaned up by the task itself)