Conversation
fix multiple artists
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: e8b586e4f5
ℹ️ 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".
|
|
||
| // Release-type subtitles and view/play counts aren't artists — drop them so | ||
| // they don't pollute topArtists at all. | ||
| if (RELEASE_TYPE_RE.test(raw)) return []; |
There was a problem hiding this comment.
Avoid dropping valid artists containing release keywords
The new RELEASE_TYPE_RE filter removes any artist string containing words like Album or Single, which also matches legitimate artist names (for example, "The Album Leaf" or "Single Mothers"). In those cases artistKeysFor returns [], so track events no longer contribute to artistMap or artist queuer stats at all, producing systematically missing leaderboard entries.
Useful? React with 👍 / 👎.
| // 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 names on commas unconditionally
Splitting raw on every comma treats single-artist names that legitimately contain commas (for example, "Earth, Wind & Fire") as multiple different artists. That corrupts topArtists counts and also drops artistId from all but the first fragment, which breaks direct artist navigation for those rows.
Useful? React with 👍 / 👎.
| accountId: string | undefined, | ||
| ) { | ||
| return useQuery({ | ||
| queryKey: ['artist-image', artistId] as const, |
There was a problem hiding this comment.
Include service/account in artist image cache key
useArtistImage caches by ['artist-image', artistId] only, but the fetch depends on serviceId and accountId. If the same artistId is viewed across different services/accounts, React Query will reuse stale data (including cached null) from a different source, causing wrong or missing avatars.
Useful? React with 👍 / 👎.
No description provided.