feat: artist portrait, race condition fix, and uniform button styling
- Load artist portrait from images.portrait.hash via QNetworkAccessManager
- Fix race condition: fire getArtistReleases after setArtist() clears sections,
not before (from onArtistLoaded instead of onSearchArtistSelected)
- Apply uniform gold (#FFB232) play/shuffle button style matching album view
- Make biography scrollable (QTextEdit with max height + scroll on overflow)
- Extend track artist name parsing to handle top_tracks {display:...} format
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -335,6 +335,12 @@ void MainWindow::onAlbumLoaded(const QJsonObject &album)
|
||||
void MainWindow::onArtistLoaded(const QJsonObject &artist)
|
||||
{
|
||||
m_content->showArtist(artist);
|
||||
// Fire release requests only after the artist page is shown — avoids the
|
||||
// race where a fast-responding release request arrives before setArtist()
|
||||
// clears the sections, causing setArtist() to wipe out the data.
|
||||
const qint64 artistId = static_cast<qint64>(artist["id"].toDouble());
|
||||
for (const char *type : {"album", "epSingle", "live", "compilation"})
|
||||
m_backend->getArtistReleases(artistId, QString::fromLatin1(type));
|
||||
statusBar()->showMessage(
|
||||
tr("Artist: %1").arg(artist["name"].toObject()["display"].toString()), 4000);
|
||||
}
|
||||
@@ -360,9 +366,6 @@ void MainWindow::onSearchAlbumSelected(const QString &albumId)
|
||||
void MainWindow::onSearchArtistSelected(qint64 artistId)
|
||||
{
|
||||
m_backend->getArtist(artistId);
|
||||
// Fire release-type requests in parallel — each updates its section when it arrives
|
||||
for (const char *type : {"album", "epSingle", "live", "compilation"})
|
||||
m_backend->getArtistReleases(artistId, QString::fromLatin1(type));
|
||||
statusBar()->showMessage(tr("Loading artist…"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user