feat: full artist release list via artist/getReleasesList
Instead of relying on the limited preview in artist/page, fire a separate artist/getReleasesList request per release type (album, epSingle, live, compilation) in parallel when loading an artist. Each result updates its section independently as it arrives, so the page populates progressively without a single large request. Also fixes the artist name in the status bar (was reading wrong field). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,8 @@ MainWindow::MainWindow(QobuzBackend *backend, QWidget *parent)
|
||||
connect(m_backend, &QobuzBackend::favArtistsLoaded, this, &MainWindow::onFavArtistsLoaded);
|
||||
connect(m_backend, &QobuzBackend::albumLoaded, this, &MainWindow::onAlbumLoaded);
|
||||
connect(m_backend, &QobuzBackend::artistLoaded, this, &MainWindow::onArtistLoaded);
|
||||
connect(m_backend, &QobuzBackend::artistReleasesLoaded,
|
||||
m_content, &MainContent::updateArtistReleases);
|
||||
connect(m_backend, &QobuzBackend::playlistLoaded, this, &MainWindow::onPlaylistLoaded);
|
||||
connect(m_backend, &QobuzBackend::playlistCreated, this, &MainWindow::onPlaylistCreated);
|
||||
connect(m_backend, &QobuzBackend::playlistDeleted, this, [this](const QJsonObject &) {
|
||||
@@ -334,7 +336,7 @@ void MainWindow::onArtistLoaded(const QJsonObject &artist)
|
||||
{
|
||||
m_content->showArtist(artist);
|
||||
statusBar()->showMessage(
|
||||
tr("Artist: %1").arg(artist["name"].toString()), 4000);
|
||||
tr("Artist: %1").arg(artist["name"].toObject()["display"].toString()), 4000);
|
||||
}
|
||||
|
||||
void MainWindow::onPlaylistLoaded(const QJsonObject &playlist)
|
||||
@@ -358,6 +360,9 @@ 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