Move lyrics providers to own thread

This commit is contained in:
Jonas Kvinge
2024-08-24 20:07:36 +02:00
parent 77e934beab
commit 2c0ad2fc88
26 changed files with 182 additions and 92 deletions

View File

@@ -45,9 +45,6 @@ class MusixmatchLyricsProvider : public JsonLyricsProvider, public MusixmatchPro
explicit MusixmatchLyricsProvider(SharedPtr<NetworkAccessManager> network, QObject *parent = nullptr);
~MusixmatchLyricsProvider() override;
bool StartSearch(const int id, const LyricsSearchRequest &request) override;
void CancelSearch(const int id) override;
private:
struct LyricsSearchContext {
explicit LyricsSearchContext() : id(-1) {}
@@ -66,6 +63,9 @@ class MusixmatchLyricsProvider : public JsonLyricsProvider, public MusixmatchPro
void EndSearch(LyricsSearchContextPtr search, const QUrl &url = QUrl());
void Error(const QString &error, const QVariant &debug = QVariant()) override;
protected Q_SLOTS:
void StartSearch(const int id, const LyricsSearchRequest &request) override;
private Q_SLOTS:
void HandleSearchReply(QNetworkReply *reply, MusixmatchLyricsProvider::LyricsSearchContextPtr search);
void HandleLyricsReply(QNetworkReply *reply, MusixmatchLyricsProvider::LyricsSearchContextPtr search, const QUrl &url);