feat: add album favorites in header and unify browse controls
Some checks failed
Build for Windows / build-windows (push) Has been cancelled
Some checks failed
Build for Windows / build-windows (push) Has been cancelled
Improve album workflow with in-header favorite toggle, keep favorite state synced from backend, and normalize browse top-bar sizing while increasing audio output buffer headroom to reduce glitches.
This commit is contained in:
@@ -48,6 +48,13 @@ MainContent::MainContent(QobuzBackend *backend, PlayQueue *queue, QWidget *paren
|
||||
return;
|
||||
emit playlistFollowToggled(id, !m_header->playlistFollowed());
|
||||
});
|
||||
QObject::connect(m_header->favButton(), &QPushButton::clicked,
|
||||
[this] {
|
||||
const QString albumId = m_header->albumId();
|
||||
if (albumId.isEmpty())
|
||||
return;
|
||||
emit albumFavoriteToggled(albumId, !m_header->albumFaved());
|
||||
});
|
||||
|
||||
m_albumList = new AlbumListView(this);
|
||||
m_artistList = new ArtistListView(this);
|
||||
@@ -77,7 +84,10 @@ void MainContent::showWelcome() { m_stack->setCurrentIndex(0); }
|
||||
|
||||
void MainContent::showAlbum(const QJsonObject &album)
|
||||
{
|
||||
m_header->setAlbum(album);
|
||||
QString albumId = album["id"].toString();
|
||||
if (albumId.isEmpty() && album["id"].isDouble())
|
||||
albumId = QString::number(static_cast<qint64>(album["id"].toDouble()));
|
||||
m_header->setAlbum(album, m_favAlbumIds.contains(albumId));
|
||||
m_tracks->loadAlbum(album);
|
||||
m_stack->setCurrentIndex(1);
|
||||
}
|
||||
@@ -131,6 +141,14 @@ void MainContent::setFavArtistIds(const QSet<qint64> &ids)
|
||||
m_artistView->setFavArtistIds(ids);
|
||||
}
|
||||
|
||||
void MainContent::setFavAlbumIds(const QSet<QString> &ids)
|
||||
{
|
||||
m_favAlbumIds = ids;
|
||||
const QString shownAlbumId = m_header->albumId();
|
||||
if (!shownAlbumId.isEmpty())
|
||||
m_header->setAlbumFaved(m_favAlbumIds.contains(shownAlbumId));
|
||||
}
|
||||
|
||||
void MainContent::onDeepShuffleTracks(const QJsonArray &tracks)
|
||||
{
|
||||
if (m_genreBrowser->tryHandleDeepShuffleTracks(tracks))
|
||||
|
||||
Reference in New Issue
Block a user