fix: artist flash on search + independent top section columns
Three fixes: 1. SearchLocal no longer applies minBlendedScore filter — index hits use scalePopularity scores that aren't comparable to blended MB+LB scores. This prevents artists from appearing in local results then disappearing when the full pipeline replaces them with score-filtered results. 2. Top section columns now render independently — tracks show as soon as they load, top releases show their own loading state or appear when ready. Previously the entire section was blocked until both finished loading. 3. Top releases column shows a loading spinner while its data is still fetching, rather than being invisible.
This commit is contained in:
@@ -124,7 +124,21 @@ func (e *Service) SearchLocal(query string) *MBSearchResult {
|
||||
|
||||
var result MBSearchResult
|
||||
mergeIndexHits(&result, indexHits)
|
||||
filterAndCap(&result)
|
||||
|
||||
// Cap counts but skip the minBlendedScore filter — index hits
|
||||
// use scalePopularity scores that shouldn't be compared to
|
||||
// blended MB+LB scores.
|
||||
if len(result.Artists) > maxResults {
|
||||
result.Artists = result.Artists[:maxResults]
|
||||
}
|
||||
|
||||
if len(result.ReleaseGroups) > maxResults {
|
||||
result.ReleaseGroups = result.ReleaseGroups[:maxResults]
|
||||
}
|
||||
|
||||
if len(result.Recordings) > maxResults {
|
||||
result.Recordings = result.Recordings[:maxResults]
|
||||
}
|
||||
|
||||
return &result
|
||||
}
|
||||
|
||||
@@ -1025,9 +1025,11 @@ export class ExploreArtistDetails extends LitElement {
|
||||
private renderTopSection() {
|
||||
const hasTracks = !this.loadingTracks && this.topTracks.length > 0;
|
||||
const hasReleases = !this.loadingTopReleases && this.topReleaseGroups.length > 0;
|
||||
const isLoading = this.loadingTracks || this.loadingTopReleases;
|
||||
const tracksLoading = this.loadingTracks;
|
||||
const releasesLoading = this.loadingTopReleases;
|
||||
|
||||
if (isLoading) {
|
||||
// Both still loading — show single loading state.
|
||||
if (tracksLoading && releasesLoading) {
|
||||
return html`
|
||||
<section>
|
||||
<h3 class="section-header">Popular</h3>
|
||||
@@ -1036,7 +1038,10 @@ export class ExploreArtistDetails extends LitElement {
|
||||
`;
|
||||
}
|
||||
|
||||
if (!hasTracks && !hasReleases) return nothing;
|
||||
// Both done, neither has data.
|
||||
if (!tracksLoading && !releasesLoading && !hasTracks && !hasReleases) {
|
||||
return nothing;
|
||||
}
|
||||
|
||||
const expanded = this.topSectionExpanded;
|
||||
const trackLimit = expanded ? 10 : 5;
|
||||
@@ -1098,7 +1103,14 @@ export class ExploreArtistDetails extends LitElement {
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
: nothing}
|
||||
: releasesLoading
|
||||
? html`
|
||||
<div class="top-section-column">
|
||||
<h3 class="section-header">Top Releases</h3>
|
||||
<div class="section-loading">Loading\u2026</div>
|
||||
</div>
|
||||
`
|
||||
: nothing}
|
||||
</div>
|
||||
${canExpand
|
||||
? html`
|
||||
|
||||
Reference in New Issue
Block a user