fix multiple artists#93
Conversation
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9283f5b88
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // a single entry, don't try to split. | ||
| if (/\d/.test(raw)) return [raw]; | ||
|
|
||
| const parts = raw.split(/,\s*/).map((s) => s.trim()).filter(Boolean); |
There was a problem hiding this comment.
Stop splitting artist keys on every comma
This unconditionally treats commas as a multi-artist delimiter, so single-artist names that legitimately contain commas (for example Tyler, The Creator) get split into multiple fake artists. In aggregateEvents, that misattributes counts and queuer stats to the wrong artistMap keys, which directly corrupts top-artist rankings for those plays.
Useful? React with 👍 / 👎.
| accountId: string | undefined, | ||
| ) { | ||
| return useQuery({ | ||
| queryKey: ['artist-image', artistId] as const, |
There was a problem hiding this comment.
Include service and account in artist-image cache key
useArtistImage caches by artistId only, but the query result depends on serviceId and accountId too. Because the query is cached with staleTime: Infinity, a prior fetch can be incorrectly reused when the same artistId appears under a different service/account context, causing wrong avatars and preventing a refetch for the current source.
Useful? React with 👍 / 👎.
No description provided.