- Switch artist view to artist/page API (proper sections: Albums, Singles & EPs, Live, Compilations; version in titles like "Deluxe") - Fix artist sections categorization using releases[].type from artist/page - Add getUser() backend call; fetch on session restore when userId=0 to fix playlist ownership (Remove from playlist / Delete playlist were missing) - Fix multi-disc double-click / Play Now queue start index (disc headers were counted in row index but excluded from currentTracksJson) - Hide redundant Album column when viewing an album - Make artist name in context header clickable (navigates to artist page) - Fix gap between title and artist name in context header (addStretch) - Fix queue panel track titles to include version field - Fix album list to show version in title column Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "albumlistview.hpp"
|
|
|
|
#include <QWidget>
|
|
#include <QLabel>
|
|
#include <QToolButton>
|
|
#include <QJsonObject>
|
|
#include <QJsonArray>
|
|
|
|
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;
|
|
};
|