Refactoring
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include <QJsonArray>
|
||||
#include <QJsonValue>
|
||||
|
||||
#include "includes/shared_ptr.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/networkaccessmanager.h"
|
||||
#include "spotifyservice.h"
|
||||
@@ -41,7 +42,7 @@
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
SpotifyBaseRequest::SpotifyBaseRequest(SpotifyService *service, NetworkAccessManager *network, QObject *parent)
|
||||
SpotifyBaseRequest::SpotifyBaseRequest(SpotifyService *service, const SharedPtr<NetworkAccessManager> network, QObject *parent)
|
||||
: QObject(parent),
|
||||
service_(service),
|
||||
network_(network) {}
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
|
||||
#include "includes/shared_ptr.h"
|
||||
|
||||
#include "spotifyservice.h"
|
||||
|
||||
class QNetworkReply;
|
||||
@@ -45,7 +47,7 @@ class SpotifyBaseRequest : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SpotifyBaseRequest(SpotifyService *service, NetworkAccessManager *network, QObject *parent = nullptr);
|
||||
explicit SpotifyBaseRequest(SpotifyService *service, const SharedPtr<NetworkAccessManager> network, QObject *parent = nullptr);
|
||||
|
||||
enum class Type {
|
||||
None,
|
||||
@@ -59,8 +61,8 @@ class SpotifyBaseRequest : public QObject {
|
||||
};
|
||||
|
||||
protected:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
QNetworkReply *CreateRequest(const QString &ressource_name, const ParamList ¶ms_provided);
|
||||
QByteArray GetReplyData(QNetworkReply *reply);
|
||||
@@ -84,8 +86,7 @@ class SpotifyBaseRequest : public QObject {
|
||||
|
||||
private:
|
||||
SpotifyService *service_;
|
||||
NetworkAccessManager *network_;
|
||||
|
||||
const SharedPtr<NetworkAccessManager> network_;
|
||||
};
|
||||
|
||||
#endif // SPOTIFYBASEREQUEST_H
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
|
||||
#include "includes/shared_ptr.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/networkaccessmanager.h"
|
||||
#include "core/song.h"
|
||||
@@ -44,7 +45,7 @@
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
SpotifyFavoriteRequest::SpotifyFavoriteRequest(SpotifyService *service, NetworkAccessManager *network, QObject *parent)
|
||||
SpotifyFavoriteRequest::SpotifyFavoriteRequest(SpotifyService *service, const SharedPtr<NetworkAccessManager> network, QObject *parent)
|
||||
: SpotifyBaseRequest(service, network, parent),
|
||||
service_(service),
|
||||
network_(network) {}
|
||||
|
||||
@@ -29,9 +29,11 @@
|
||||
#include <QByteArray>
|
||||
#include <QString>
|
||||
|
||||
#include "spotifybaserequest.h"
|
||||
#include "includes/shared_ptr.h"
|
||||
#include "core/song.h"
|
||||
|
||||
#include "spotifybaserequest.h"
|
||||
|
||||
class QNetworkReply;
|
||||
class SpotifyService;
|
||||
class NetworkAccessManager;
|
||||
@@ -40,7 +42,7 @@ class SpotifyFavoriteRequest : public SpotifyBaseRequest {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SpotifyFavoriteRequest(SpotifyService *service, NetworkAccessManager *network, QObject *parent = nullptr);
|
||||
explicit SpotifyFavoriteRequest(SpotifyService *service, const SharedPtr<NetworkAccessManager> network, QObject *parent = nullptr);
|
||||
~SpotifyFavoriteRequest() override;
|
||||
|
||||
enum FavoriteType {
|
||||
@@ -82,7 +84,7 @@ class SpotifyFavoriteRequest : public SpotifyBaseRequest {
|
||||
void RemoveFavoritesRequest(const FavoriteType type, const QString &ids_list, const QByteArray &json_data, const SongList &songs);
|
||||
|
||||
SpotifyService *service_;
|
||||
NetworkAccessManager *network_;
|
||||
const SharedPtr<NetworkAccessManager> network_;
|
||||
QList <QNetworkReply*> replies_;
|
||||
|
||||
};
|
||||
|
||||
@@ -37,8 +37,7 @@
|
||||
#include "core/logging.h"
|
||||
#include "core/networkaccessmanager.h"
|
||||
#include "core/song.h"
|
||||
#include "core/application.h"
|
||||
#include "utilities/timeconstants.h"
|
||||
#include "constants/timeconstants.h"
|
||||
#include "utilities/imageutils.h"
|
||||
#include "utilities/coverutils.h"
|
||||
#include "spotifyservice.h"
|
||||
@@ -57,10 +56,9 @@ const int kMaxConcurrentAlbumCoverRequests = 10;
|
||||
const int kFlushRequestsDelay = 200;
|
||||
}
|
||||
|
||||
SpotifyRequest::SpotifyRequest(SpotifyService *service, Application *app, NetworkAccessManager *network, Type type, QObject *parent)
|
||||
SpotifyRequest::SpotifyRequest(SpotifyService *service, const SharedPtr<NetworkAccessManager> network, const Type type, QObject *parent)
|
||||
: SpotifyBaseRequest(service, network, parent),
|
||||
service_(service),
|
||||
app_(app),
|
||||
network_(network),
|
||||
timer_flush_requests_(new QTimer(this)),
|
||||
type_(type),
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
#include <QJsonObject>
|
||||
#include <QTimer>
|
||||
|
||||
#include "includes/shared_ptr.h"
|
||||
#include "core/song.h"
|
||||
#include "spotifybaserequest.h"
|
||||
|
||||
class QNetworkReply;
|
||||
class Application;
|
||||
class NetworkAccessManager;
|
||||
class SpotifyService;
|
||||
|
||||
@@ -49,7 +49,7 @@ class SpotifyRequest : public SpotifyBaseRequest {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SpotifyRequest(SpotifyService *service, Application *app, NetworkAccessManager *network, Type type, QObject *parent);
|
||||
explicit SpotifyRequest(SpotifyService *service, const SharedPtr<NetworkAccessManager> network, const Type type, QObject *parent);
|
||||
~SpotifyRequest() override;
|
||||
|
||||
void ReloadSettings();
|
||||
@@ -163,11 +163,10 @@ class SpotifyRequest : public SpotifyBaseRequest {
|
||||
|
||||
private:
|
||||
SpotifyService *service_;
|
||||
Application *app_;
|
||||
NetworkAccessManager *network_;
|
||||
const SharedPtr<NetworkAccessManager> network_;
|
||||
QTimer *timer_flush_requests_;
|
||||
|
||||
Type type_;
|
||||
const Type type_;
|
||||
bool fetchalbums_;
|
||||
QString coversize_;
|
||||
|
||||
|
||||
@@ -45,15 +45,14 @@
|
||||
#include <QSettings>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "core/application.h"
|
||||
#include "core/player.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/networkaccessmanager.h"
|
||||
#include "core/database.h"
|
||||
#include "core/song.h"
|
||||
#include "core/settings.h"
|
||||
#include "core/taskmanager.h"
|
||||
#include "core/database.h"
|
||||
#include "core/networkaccessmanager.h"
|
||||
#include "core/localredirectserver.h"
|
||||
#include "utilities/timeconstants.h"
|
||||
#include "constants/timeconstants.h"
|
||||
#include "utilities/randutils.h"
|
||||
#include "streaming/streamingsearchview.h"
|
||||
#include "collection/collectionbackend.h"
|
||||
@@ -62,8 +61,7 @@
|
||||
#include "spotifybaserequest.h"
|
||||
#include "spotifyrequest.h"
|
||||
#include "spotifyfavoriterequest.h"
|
||||
#include "settings/settingsdialog.h"
|
||||
#include "settings/spotifysettingspage.h"
|
||||
#include "constants/spotifysettings.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
@@ -87,10 +85,13 @@ constexpr char kSongsTable[] = "spotify_songs";
|
||||
using std::make_shared;
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
SpotifyService::SpotifyService(Application *app, QObject *parent)
|
||||
: StreamingService(Song::Source::Spotify, u"Spotify"_s, u"spotify"_s, QLatin1String(SpotifySettingsPage::kSettingsGroup), SettingsDialog::Page::Spotify, app, parent),
|
||||
app_(app),
|
||||
network_(new NetworkAccessManager(this)),
|
||||
SpotifyService::SpotifyService(const SharedPtr<TaskManager> task_manager,
|
||||
const SharedPtr<Database> database,
|
||||
const SharedPtr<NetworkAccessManager> network,
|
||||
const SharedPtr<AlbumCoverLoader> albumcover_loader,
|
||||
QObject *parent)
|
||||
: StreamingService(Song::Source::Spotify, u"Spotify"_s, u"spotify"_s, QLatin1String(SpotifySettings::kSettingsGroup), parent),
|
||||
network_(network),
|
||||
artists_collection_backend_(nullptr),
|
||||
albums_collection_backend_(nullptr),
|
||||
songs_collection_backend_(nullptr),
|
||||
@@ -117,21 +118,21 @@ SpotifyService::SpotifyService(Application *app, QObject *parent)
|
||||
// Backends
|
||||
|
||||
artists_collection_backend_ = make_shared<CollectionBackend>();
|
||||
artists_collection_backend_->moveToThread(app_->database()->thread());
|
||||
artists_collection_backend_->Init(app_->database(), app->task_manager(), Song::Source::Spotify, QLatin1String(kArtistsSongsTable));
|
||||
artists_collection_backend_->moveToThread(database->thread());
|
||||
artists_collection_backend_->Init(database, task_manager, Song::Source::Spotify, QLatin1String(kArtistsSongsTable));
|
||||
|
||||
albums_collection_backend_ = make_shared<CollectionBackend>();
|
||||
albums_collection_backend_->moveToThread(app_->database()->thread());
|
||||
albums_collection_backend_->Init(app_->database(), app->task_manager(), Song::Source::Spotify, QLatin1String(kAlbumsSongsTable));
|
||||
albums_collection_backend_->moveToThread(database->thread());
|
||||
albums_collection_backend_->Init(database, task_manager, Song::Source::Spotify, QLatin1String(kAlbumsSongsTable));
|
||||
|
||||
songs_collection_backend_ = make_shared<CollectionBackend>();
|
||||
songs_collection_backend_->moveToThread(app_->database()->thread());
|
||||
songs_collection_backend_->Init(app_->database(), app->task_manager(), Song::Source::Spotify, QLatin1String(kSongsTable));
|
||||
songs_collection_backend_->moveToThread(database->thread());
|
||||
songs_collection_backend_->Init(database, task_manager, Song::Source::Spotify, QLatin1String(kSongsTable));
|
||||
|
||||
// Models
|
||||
artists_collection_model_ = new CollectionModel(artists_collection_backend_, app_, this);
|
||||
albums_collection_model_ = new CollectionModel(albums_collection_backend_, app_, this);
|
||||
songs_collection_model_ = new CollectionModel(songs_collection_backend_, app_, this);
|
||||
artists_collection_model_ = new CollectionModel(artists_collection_backend_, albumcover_loader, this);
|
||||
albums_collection_model_ = new CollectionModel(albums_collection_backend_, albumcover_loader, this);
|
||||
songs_collection_model_ = new CollectionModel(songs_collection_backend_, albumcover_loader, this);
|
||||
|
||||
timer_refresh_login_->setSingleShot(true);
|
||||
QObject::connect(timer_refresh_login_, &QTimer::timeout, this, &SpotifyService::RequestNewAccessToken);
|
||||
@@ -200,21 +201,17 @@ void SpotifyService::ExitReceived() {
|
||||
|
||||
}
|
||||
|
||||
void SpotifyService::ShowConfig() {
|
||||
app_->OpenSettingsDialogAtPage(SettingsDialog::Page::Spotify);
|
||||
}
|
||||
|
||||
void SpotifyService::LoadSession() {
|
||||
|
||||
refresh_login_timer_.setSingleShot(true);
|
||||
QObject::connect(&refresh_login_timer_, &QTimer::timeout, this, &SpotifyService::RequestNewAccessToken);
|
||||
|
||||
Settings s;
|
||||
s.beginGroup(SpotifySettingsPage::kSettingsGroup);
|
||||
access_token_ = s.value("access_token").toString();
|
||||
refresh_token_ = s.value("refresh_token").toString();
|
||||
expires_in_ = s.value("expires_in").toLongLong();
|
||||
login_time_ = s.value("login_time").toLongLong();
|
||||
s.beginGroup(SpotifySettings::kSettingsGroup);
|
||||
access_token_ = s.value(SpotifySettings::kAccessToken).toString();
|
||||
refresh_token_ = s.value(SpotifySettings::kRefreshToken).toString();
|
||||
expires_in_ = s.value(SpotifySettings::kExpiresIn).toLongLong();
|
||||
login_time_ = s.value(SpotifySettings::kLoginTime).toLongLong();
|
||||
s.endGroup();
|
||||
|
||||
if (!refresh_token_.isEmpty()) {
|
||||
@@ -229,16 +226,16 @@ void SpotifyService::LoadSession() {
|
||||
void SpotifyService::ReloadSettings() {
|
||||
|
||||
Settings s;
|
||||
s.beginGroup(SpotifySettingsPage::kSettingsGroup);
|
||||
s.beginGroup(SpotifySettings::kSettingsGroup);
|
||||
|
||||
enabled_ = s.value("enabled", false).toBool();
|
||||
enabled_ = s.value(SpotifySettings::kEnabled, false).toBool();
|
||||
|
||||
quint64 search_delay = std::max(s.value("searchdelay", 1500).toInt(), 500);
|
||||
artistssearchlimit_ = s.value("artistssearchlimit", 4).toInt();
|
||||
albumssearchlimit_ = s.value("albumssearchlimit", 10).toInt();
|
||||
songssearchlimit_ = s.value("songssearchlimit", 10).toInt();
|
||||
fetchalbums_ = s.value("fetchalbums", false).toBool();
|
||||
download_album_covers_ = s.value("downloadalbumcovers", true).toBool();
|
||||
quint64 search_delay = std::max(s.value(SpotifySettings::kSearchDelay, 1500).toInt(), 500);
|
||||
artistssearchlimit_ = s.value(SpotifySettings::kArtistsSearchLimit, 4).toInt();
|
||||
albumssearchlimit_ = s.value(SpotifySettings::kAlbumsSearchLimit, 10).toInt();
|
||||
songssearchlimit_ = s.value(SpotifySettings::kSongsSearchLimit, 10).toInt();
|
||||
fetchalbums_ = s.value(SpotifySettings::kFetchAlbums, false).toBool();
|
||||
download_album_covers_ = s.value(SpotifySettings::kDownloadAlbumCovers, true).toBool();
|
||||
|
||||
s.endGroup();
|
||||
|
||||
@@ -310,11 +307,11 @@ void SpotifyService::Deauthenticate() {
|
||||
login_time_ = 0;
|
||||
|
||||
Settings s;
|
||||
s.beginGroup(SpotifySettingsPage::kSettingsGroup);
|
||||
s.remove("access_token");
|
||||
s.remove("refresh_token");
|
||||
s.remove("expires_in");
|
||||
s.remove("login_time");
|
||||
s.beginGroup(SpotifySettings::kSettingsGroup);
|
||||
s.remove(SpotifySettings::kAccessToken);
|
||||
s.remove(SpotifySettings::kRefreshToken);
|
||||
s.remove(SpotifySettings::kExpiresIn);
|
||||
s.remove(SpotifySettings::kLoginTime);
|
||||
s.endGroup();
|
||||
|
||||
refresh_login_timer_.stop();
|
||||
@@ -484,11 +481,11 @@ void SpotifyService::AccessTokenRequestFinished(QNetworkReply *reply) {
|
||||
login_time_ = QDateTime::currentSecsSinceEpoch();
|
||||
|
||||
Settings s;
|
||||
s.beginGroup(SpotifySettingsPage::kSettingsGroup);
|
||||
s.setValue("access_token", access_token_);
|
||||
s.setValue("refresh_token", refresh_token_);
|
||||
s.setValue("expires_in", expires_in_);
|
||||
s.setValue("login_time", login_time_);
|
||||
s.beginGroup(SpotifySettings::kSettingsGroup);
|
||||
s.setValue(SpotifySettings::kAccessToken, access_token_);
|
||||
s.setValue(SpotifySettings::kRefreshToken, refresh_token_);
|
||||
s.setValue(SpotifySettings::kExpiresIn, expires_in_);
|
||||
s.setValue(SpotifySettings::kLoginTime, login_time_);
|
||||
s.endGroup();
|
||||
|
||||
if (expires_in_ > 0) {
|
||||
@@ -517,12 +514,12 @@ void SpotifyService::GetArtists() {
|
||||
|
||||
if (!authenticated()) {
|
||||
Q_EMIT ArtistsResults(SongMap(), tr("Not authenticated with Spotify."));
|
||||
ShowConfig();
|
||||
Q_EMIT OpenSettingsDialog(kSource);
|
||||
return;
|
||||
}
|
||||
|
||||
ResetArtistsRequest();
|
||||
artists_request_.reset(new SpotifyRequest(this, app_, network_, SpotifyBaseRequest::Type::FavouriteArtists, this), [](SpotifyRequest *request) { request->deleteLater(); });
|
||||
artists_request_.reset(new SpotifyRequest(this, network_, SpotifyBaseRequest::Type::FavouriteArtists, this), [](SpotifyRequest *request) { request->deleteLater(); });
|
||||
QObject::connect(&*artists_request_, &SpotifyRequest::Results, this, &SpotifyService::ArtistsResultsReceived);
|
||||
QObject::connect(&*artists_request_, &SpotifyRequest::UpdateStatus, this, &SpotifyService::ArtistsUpdateStatusReceived);
|
||||
QObject::connect(&*artists_request_, &SpotifyRequest::ProgressSetMaximum, this, &SpotifyService::ArtistsProgressSetMaximumReceived);
|
||||
@@ -569,12 +566,12 @@ void SpotifyService::GetAlbums() {
|
||||
|
||||
if (!authenticated()) {
|
||||
Q_EMIT AlbumsResults(SongMap(), tr("Not authenticated with Spotify."));
|
||||
ShowConfig();
|
||||
Q_EMIT OpenSettingsDialog(kSource);
|
||||
return;
|
||||
}
|
||||
|
||||
ResetAlbumsRequest();
|
||||
albums_request_.reset(new SpotifyRequest(this, app_, network_, SpotifyBaseRequest::Type::FavouriteAlbums, this), [](SpotifyRequest *request) { request->deleteLater(); });
|
||||
albums_request_.reset(new SpotifyRequest(this, network_, SpotifyBaseRequest::Type::FavouriteAlbums, this), [](SpotifyRequest *request) { request->deleteLater(); });
|
||||
QObject::connect(&*albums_request_, &SpotifyRequest::Results, this, &SpotifyService::AlbumsResultsReceived);
|
||||
QObject::connect(&*albums_request_, &SpotifyRequest::UpdateStatus, this, &SpotifyService::AlbumsUpdateStatusReceived);
|
||||
QObject::connect(&*albums_request_, &SpotifyRequest::ProgressSetMaximum, this, &SpotifyService::AlbumsProgressSetMaximumReceived);
|
||||
@@ -621,12 +618,12 @@ void SpotifyService::GetSongs() {
|
||||
|
||||
if (!authenticated()) {
|
||||
Q_EMIT SongsResults(SongMap(), tr("Not authenticated with Spotify."));
|
||||
ShowConfig();
|
||||
Q_EMIT OpenSettingsDialog(kSource);
|
||||
return;
|
||||
}
|
||||
|
||||
ResetSongsRequest();
|
||||
songs_request_.reset(new SpotifyRequest(this, app_, network_, SpotifyBaseRequest::Type::FavouriteSongs, this), [](SpotifyRequest *request) { request->deleteLater(); });
|
||||
songs_request_.reset(new SpotifyRequest(this, network_, SpotifyBaseRequest::Type::FavouriteSongs, this), [](SpotifyRequest *request) { request->deleteLater(); });
|
||||
QObject::connect(&*songs_request_, &SpotifyRequest::Results, this, &SpotifyService::SongsResultsReceived);
|
||||
QObject::connect(&*songs_request_, &SpotifyRequest::UpdateStatus, this, &SpotifyService::SongsUpdateStatusReceived);
|
||||
QObject::connect(&*songs_request_, &SpotifyRequest::ProgressSetMaximum, this, &SpotifyService::SongsProgressSetMaximumReceived);
|
||||
@@ -681,7 +678,7 @@ void SpotifyService::StartSearch() {
|
||||
|
||||
if (!authenticated()) {
|
||||
Q_EMIT SearchResults(pending_search_id_, SongMap(), tr("Not authenticated with Spotify."));
|
||||
ShowConfig();
|
||||
Q_EMIT OpenSettingsDialog(kSource);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -714,7 +711,7 @@ void SpotifyService::SendSearch() {
|
||||
return;
|
||||
}
|
||||
|
||||
search_request_.reset(new SpotifyRequest(this, app_, network_, type, this), [](SpotifyRequest *request) { request->deleteLater(); });
|
||||
search_request_.reset(new SpotifyRequest(this, network_, type, this), [](SpotifyRequest *request) { request->deleteLater(); });
|
||||
|
||||
QObject::connect(search_request_.get(), &SpotifyRequest::Results, this, &SpotifyService::SearchResultsReceived);
|
||||
QObject::connect(search_request_.get(), &SpotifyRequest::UpdateStatus, this, &SpotifyService::SearchUpdateStatus);
|
||||
|
||||
@@ -37,16 +37,17 @@
|
||||
#include <QSslError>
|
||||
#include <QTimer>
|
||||
|
||||
#include "core/shared_ptr.h"
|
||||
#include "includes/shared_ptr.h"
|
||||
#include "core/song.h"
|
||||
#include "streaming/streamingservice.h"
|
||||
#include "streaming/streamingsearchview.h"
|
||||
#include "settings/spotifysettingspage.h"
|
||||
|
||||
class QNetworkReply;
|
||||
|
||||
class Application;
|
||||
class TaskManager;
|
||||
class Database;
|
||||
class NetworkAccessManager;
|
||||
class AlbumCoverLoader;
|
||||
class SpotifyRequest;
|
||||
class SpotifyFavoriteRequest;
|
||||
class SpotifyStreamURLRequest;
|
||||
@@ -59,7 +60,12 @@ class SpotifyService : public StreamingService {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SpotifyService(Application *app, QObject *parent = nullptr);
|
||||
explicit SpotifyService(const SharedPtr<TaskManager> task_manager,
|
||||
const SharedPtr<Database> database,
|
||||
const SharedPtr<NetworkAccessManager> network,
|
||||
const SharedPtr<AlbumCoverLoader> albumcover_Loader,
|
||||
QObject *parent = nullptr);
|
||||
|
||||
~SpotifyService() override;
|
||||
|
||||
static const Song::Source kSource;
|
||||
@@ -71,8 +77,6 @@ class SpotifyService : public StreamingService {
|
||||
int Search(const QString &text, StreamingSearchView::SearchType type) override;
|
||||
void CancelSearch() override;
|
||||
|
||||
Application *app() { return app_; }
|
||||
|
||||
int artistssearchlimit() const { return artistssearchlimit_; }
|
||||
int albumssearchlimit() const { return albumssearchlimit_; }
|
||||
int songssearchlimit() const { return songssearchlimit_; }
|
||||
@@ -96,7 +100,6 @@ class SpotifyService : public StreamingService {
|
||||
CollectionFilter *songs_collection_filter_model() override { return songs_collection_model_->filter(); }
|
||||
|
||||
public Q_SLOTS:
|
||||
void ShowConfig() override;
|
||||
void Authenticate();
|
||||
void Deauthenticate();
|
||||
void GetArtists() override;
|
||||
@@ -128,16 +131,15 @@ class SpotifyService : public StreamingService {
|
||||
void SongsUpdateProgressReceived(const int id, const int progress);
|
||||
|
||||
private:
|
||||
typedef QPair<QString, QString> Param;
|
||||
typedef QList<Param> ParamList;
|
||||
using Param = QPair<QString, QString>;
|
||||
using ParamList = QList<Param>;
|
||||
|
||||
void LoadSession();
|
||||
void RequestAccessToken(const QString &code = QString(), const QUrl &redirect_url = QUrl());
|
||||
void SendSearch();
|
||||
void LoginError(const QString &error = QString(), const QVariant &debug = QVariant());
|
||||
|
||||
Application *app_;
|
||||
NetworkAccessManager *network_;
|
||||
const SharedPtr<NetworkAccessManager> network_;
|
||||
|
||||
SharedPtr<CollectionBackend> artists_collection_backend_;
|
||||
SharedPtr<CollectionBackend> albums_collection_backend_;
|
||||
|
||||
Reference in New Issue
Block a user