feat: add autoplay suggestions when queue runs out
Some checks failed
Build for Windows / build-windows (push) Has been cancelled

This commit is contained in:
joren
2026-03-30 23:14:43 +02:00
parent 2da934f3f6
commit cfd91f96b5
11 changed files with 208 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QJsonObject>
#include <QVector>
class MainToolBar : public QToolBar
{
@@ -47,6 +48,8 @@ private slots:
void onTrackTransitioned();
void onQueueChanged();
void onShuffleToggled(bool checked);
void onAutoplayToggled(bool checked);
void onDynamicSuggestionsLoaded(const QJsonObject &result);
void fetchAlbumArt(const QString &url);
void onAlbumArtReady(QNetworkReply *reply);
@@ -65,6 +68,7 @@ private:
QLabel *m_position = nullptr;
QWidget *m_rightSpacer = nullptr;
QAction *m_shuffle = nullptr;
QAction *m_autoplay = nullptr;
VolumeButton *m_volume = nullptr;
QAction *m_queueBtn = nullptr;
QAction *m_search = nullptr;
@@ -72,6 +76,10 @@ private:
QNetworkAccessManager *m_nam = nullptr;
QString m_currentArtUrl;
QJsonObject m_currentTrack;
QVector<QJsonObject> m_recentTracks;
bool m_playing = false;
bool m_seeking = false;
bool m_fetchingAutoplay = false;
void requestAutoplaySuggestions();
};