Fix minor code issues

This commit is contained in:
Jonas Kvinge
2019-09-15 20:27:32 +02:00
parent 83e10aac27
commit 2d67279180
147 changed files with 644 additions and 329 deletions

View File

@@ -81,7 +81,7 @@ class TidalBaseRequest : public QObject {
QString ErrorsToHTML(const QStringList &errors);
QString api_url() { return QString(kApiUrl); }
const bool oauth() { return service_->oauth(); }
bool oauth() { return service_->oauth(); }
QString client_id() { return service_->client_id(); }
QString api_token() { return service_->api_token(); }
quint64 user_id() { return service_->user_id(); }

View File

@@ -908,6 +908,8 @@ void TidalRequest::SongsFinishCheck(const qint64 artist_id, const qint64 album_i
int TidalRequest::ParseSong(Song &song, const QJsonObject &json_obj, const qint64 artist_id_requested, const qint64 album_id_requested, const QString &album_artist) {
Q_UNUSED(artist_id_requested);
if (
!json_obj.contains("album") ||
!json_obj.contains("allowStreaming") ||

View File

@@ -104,8 +104,8 @@ class TidalRequest : public TidalBaseRequest {
QString filename;
};
const bool IsQuery() { return (type_ == QueryType_Artists || type_ == QueryType_Albums || type_ == QueryType_Songs); }
const bool IsSearch() { return (type_ == QueryType_SearchArtists || type_ == QueryType_SearchAlbums || type_ == QueryType_SearchSongs); }
bool IsQuery() { return (type_ == QueryType_Artists || type_ == QueryType_Albums || type_ == QueryType_Songs); }
bool IsSearch() { return (type_ == QueryType_SearchArtists || type_ == QueryType_SearchAlbums || type_ == QueryType_SearchSongs); }
void GetArtists();
void GetAlbums();

View File

@@ -700,18 +700,22 @@ void TidalService::GetArtists() {
}
void TidalService::ArtistsResultsReceived(const int id, const SongList &songs, const QString &error) {
Q_UNUSED(id);
emit ArtistsResults(songs, error);
}
void TidalService::ArtistsUpdateStatusReceived(const int id, const QString &text) {
Q_UNUSED(id);
emit ArtistsUpdateStatus(text);
}
void TidalService::ArtistsProgressSetMaximumReceived(const int id, const int max) {
Q_UNUSED(id);
emit ArtistsProgressSetMaximum(max);
}
void TidalService::ArtistsUpdateProgressReceived(const int id, const int progress) {
Q_UNUSED(id);
emit ArtistsUpdateProgress(progress);
}
@@ -753,18 +757,22 @@ void TidalService::GetAlbums() {
}
void TidalService::AlbumsResultsReceived(const int id, const SongList &songs, const QString &error) {
Q_UNUSED(id);
emit AlbumsResults(songs, error);
}
void TidalService::AlbumsUpdateStatusReceived(const int id, const QString &text) {
Q_UNUSED(id);
emit AlbumsUpdateStatus(text);
}
void TidalService::AlbumsProgressSetMaximumReceived(const int id, const int max) {
Q_UNUSED(id);
emit AlbumsProgressSetMaximum(max);
}
void TidalService::AlbumsUpdateProgressReceived(const int id, const int progress) {
Q_UNUSED(id);
emit AlbumsUpdateProgress(progress);
}
@@ -806,18 +814,22 @@ void TidalService::GetSongs() {
}
void TidalService::SongsResultsReceived(const int id, const SongList &songs, const QString &error) {
Q_UNUSED(id);
emit SongsResults(songs, error);
}
void TidalService::SongsUpdateStatusReceived(const int id, const QString &text) {
Q_UNUSED(id);
emit SongsUpdateStatus(text);
}
void TidalService::SongsProgressSetMaximumReceived(const int id, const int max) {
Q_UNUSED(id);
emit SongsProgressSetMaximum(max);
}
void TidalService::SongsUpdateProgressReceived(const int id, const int progress) {
Q_UNUSED(id);
emit SongsUpdateProgress(progress);
}

View File

@@ -68,11 +68,11 @@ class TidalService : public InternetService {
int Search(const QString &query, InternetSearch::SearchType type);
void CancelSearch();
const int max_login_attempts() { return kLoginAttempts; }
int max_login_attempts() { return kLoginAttempts; }
Application *app() { return app_; }
const bool oauth() { return oauth_; }
bool oauth() { return oauth_; }
QString client_id() { return client_id_; }
QString api_token() { return api_token_; }
quint64 user_id() { return user_id_; }
@@ -92,9 +92,9 @@ class TidalService : public InternetService {
QString access_token() { return access_token_; }
QString session_id() { return session_id_; }
const bool authenticated() { return (!access_token_.isEmpty() || !session_id_.isEmpty()); }
const bool login_sent() { return login_sent_; }
const bool login_attempts() { return login_attempts_; }
bool authenticated() { return (!access_token_.isEmpty() || !session_id_.isEmpty()); }
bool login_sent() { return login_sent_; }
bool login_attempts() { return login_attempts_; }
void GetStreamURL(const QUrl &url);

View File

@@ -47,7 +47,7 @@ class TidalStreamURLRequest : public TidalBaseRequest {
void NeedLogin() { need_login_ = true; }
void Cancel();
const bool oauth() { return service_->oauth(); }
bool oauth() { return service_->oauth(); }
TidalSettingsPage::StreamUrlMethod stream_url_method() { return service_->stream_url_method(); }
QUrl original_url() { return original_url_; }
int song_id() { return song_id_; }