#pragma once #include "albumlistview.hpp" #include #include #include #include #include class AlbumListView; /// One collapsible section (e.g. "Albums", "EPs & Singles") inside ArtistView. class ArtistSection : public QWidget { Q_OBJECT public: explicit ArtistSection(const QString &title, QWidget *parent = nullptr); void setAlbums(const QJsonArray &albums); bool isEmpty() const; signals: void albumSelected(const QString &albumId); private: QString m_baseTitle; QToolButton *m_toggle = nullptr; AlbumListView *m_list = nullptr; void updateToggleText(int count); }; /// Artist detail page: name, biography, and albums split into collapsible sections /// (Albums / EPs & Singles / Other) keyed on the release_type field. class ArtistView : public QWidget { Q_OBJECT public: explicit ArtistView(QWidget *parent = nullptr); void setArtist(const QJsonObject &artist); signals: void albumSelected(const QString &albumId); private: QLabel *m_nameLabel = nullptr; QLabel *m_bioLabel = nullptr; ArtistSection *m_secAlbums = nullptr; ArtistSection *m_secEps = nullptr; ArtistSection *m_secLive = nullptr; ArtistSection *m_secCompilations = nullptr; ArtistSection *m_secOther = nullptr; };