From dbc19ad71cbac5166aa0b82c97b726b464f4fdca Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 6 Jul 2017 10:33:13 +0200 Subject: Implemented MusicBrainz lookup Wow, what a convoluted api, to say the least... They have documentation, which is good, but the query syntax definitely needs more explaining, foremost how to encode non-ASCII characters and names with whitspaces... Well, it kinda works, but the Other Albums sections can be waaaaay off... --- webdownloader.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 webdownloader.h (limited to 'webdownloader.h') diff --git a/webdownloader.h b/webdownloader.h new file mode 100644 index 0000000..522ec86 --- /dev/null +++ b/webdownloader.h @@ -0,0 +1,32 @@ +#ifndef WEBDOWNLOADER_H +#define WEBDOWNLOADER_H + +#include +#include +#include + +class WebDownloader : public QObject { + Q_OBJECT + public: + WebDownloader(QObject *parent = 0); + void fetchData(QString artist, QString album); + const QString album() const { return mAlbum; } + const QString artist() const { return mArtist; } + const QStringList data() const { return mData; } + const QMap otherData() const { return mOtherData; } + + signals: + void done(); + + private slots: + void dlFinished(QNetworkReply *reply); + + private: + QNetworkAccessManager *mAccessMgr; + QString mArtist; + QString mAlbum; + QStringList mData; + QMap mOtherData; +}; + +#endif // WEBDOWNLOADER_H -- cgit v1.2.3-70-g09d2