feat: artist/page endpoint, multi-disc fix, playlist ownership, UX improvements

- 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>
This commit is contained in:
joren
2026-03-24 23:09:04 +01:00
parent 69fb818c38
commit 872fdecdce
16 changed files with 272 additions and 58 deletions

View File

@@ -49,11 +49,16 @@ public:
m_title->setWordWrap(true);
vlay->addWidget(m_title);
m_subtitle = new QLabel(info);
m_subtitle = new QPushButton(info);
m_subtitle->setFlat(true);
m_subtitle->setStyleSheet(QStringLiteral(
"QPushButton { border: none; background: none; text-align: left; padding: 0; margin: 0; }"
"QPushButton:enabled:hover { color: #FFB232; }"
"QPushButton:!enabled { color: palette(text); }"
));
QFont sf = m_subtitle->font();
sf.setPointSize(sf.pointSize() + 1);
m_subtitle->setFont(sf);
m_subtitle->setWordWrap(true);
vlay->addWidget(m_subtitle);
m_meta = new QLabel(info);
@@ -90,6 +95,7 @@ public:
btnRow->addStretch();
vlay->addLayout(btnRow);
vlay->addStretch(1);
hlay->addWidget(info, 1);
@@ -108,10 +114,16 @@ public:
QPushButton *playButton() { return m_playBtn; }
QPushButton *shuffleButton() { return m_shuffleBtn; }
QPushButton *subtitleButton() { return m_subtitle; }
qint64 artistId() const { return m_artistId; }
void setAlbum(const QJsonObject &album)
{
m_title->setText(album["title"].toString());
m_artistId = static_cast<qint64>(album["artist"].toObject()["id"].toDouble());
m_subtitle->setText(album["artist"].toObject()["name"].toString());
m_subtitle->setEnabled(m_artistId > 0);
m_subtitle->setCursor(m_artistId > 0 ? Qt::PointingHandCursor : Qt::ArrowCursor);
m_meta->setText(buildAlbumMeta(album));
fetchArt(album["image"].toObject());
show();
@@ -120,9 +132,12 @@ public:
void setPlaylist(const QJsonObject &playlist)
{
m_title->setText(playlist["name"].toString());
m_artistId = 0;
const QString desc = playlist["description"].toString();
const QString owner = playlist["owner"].toObject()["name"].toString();
m_subtitle->setText(desc.isEmpty() ? owner : desc);
m_subtitle->setEnabled(false);
m_subtitle->setCursor(Qt::ArrowCursor);
m_meta->setText(buildPlaylistMeta(playlist));
// Try images300 → images150 → images (API returns mosaic arrays, not image_rectangle)
@@ -200,10 +215,11 @@ private:
QLabel *m_art = nullptr;
QLabel *m_title = nullptr;
QLabel *m_subtitle = nullptr;
QPushButton *m_subtitle = nullptr;
QLabel *m_meta = nullptr;
QPushButton *m_playBtn = nullptr;
QPushButton *m_shuffleBtn = nullptr;
QNetworkAccessManager *m_nam = nullptr;
QString m_currentArtUrl;
qint64 m_artistId = 0;
};