Replace emit with Q_EMIT
This commit is contained in:
@@ -127,7 +127,7 @@ QByteArray TidalBaseRequest::GetReplyData(QNetworkReply *reply, const bool send_
|
||||
}
|
||||
else {
|
||||
qLog(Info) << "Tidal:" << "Attempting to login.";
|
||||
emit RequestLogin();
|
||||
Q_EMIT RequestLogin();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -178,13 +178,13 @@ void TidalFavoriteRequest::AddFavoritesReply(QNetworkReply *reply, const Favorit
|
||||
|
||||
switch (type) {
|
||||
case FavoriteType::Artists:
|
||||
emit ArtistsAdded(songs);
|
||||
Q_EMIT ArtistsAdded(songs);
|
||||
break;
|
||||
case FavoriteType::Albums:
|
||||
emit AlbumsAdded(songs);
|
||||
Q_EMIT AlbumsAdded(songs);
|
||||
break;
|
||||
case FavoriteType::Songs:
|
||||
emit SongsAdded(songs);
|
||||
Q_EMIT SongsAdded(songs);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -286,13 +286,13 @@ void TidalFavoriteRequest::RemoveFavoritesReply(QNetworkReply *reply, const Favo
|
||||
|
||||
switch (type) {
|
||||
case FavoriteType::Artists:
|
||||
emit ArtistsRemoved(songs);
|
||||
Q_EMIT ArtistsRemoved(songs);
|
||||
break;
|
||||
case FavoriteType::Albums:
|
||||
emit AlbumsRemoved(songs);
|
||||
Q_EMIT AlbumsRemoved(songs);
|
||||
break;
|
||||
case FavoriteType::Songs:
|
||||
emit SongsRemoved(songs);
|
||||
Q_EMIT SongsRemoved(songs);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ void TidalRequest::LoginComplete(const bool success, const QString &error) {
|
||||
void TidalRequest::Process() {
|
||||
|
||||
if (!service_->authenticated()) {
|
||||
emit UpdateStatus(query_id_, tr("Authenticating..."));
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Authenticating..."));
|
||||
need_login_ = true;
|
||||
service_->TryLogin();
|
||||
return;
|
||||
@@ -226,8 +226,8 @@ void TidalRequest::Search(const int query_id, const QString &search_text) {
|
||||
|
||||
void TidalRequest::GetArtists() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Receiving artists..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Receiving artists..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddArtistsRequest();
|
||||
|
||||
}
|
||||
@@ -274,8 +274,8 @@ void TidalRequest::FlushArtistsRequests() {
|
||||
|
||||
void TidalRequest::GetAlbums() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Receiving albums..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Receiving albums..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddAlbumsRequest();
|
||||
|
||||
}
|
||||
@@ -322,8 +322,8 @@ void TidalRequest::FlushAlbumsRequests() {
|
||||
|
||||
void TidalRequest::GetSongs() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Receiving songs..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Receiving songs..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddSongsRequest();
|
||||
|
||||
}
|
||||
@@ -370,8 +370,8 @@ void TidalRequest::FlushSongsRequests() {
|
||||
|
||||
void TidalRequest::ArtistsSearch() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Searching..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Searching..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddArtistsSearchRequest();
|
||||
|
||||
}
|
||||
@@ -384,8 +384,8 @@ void TidalRequest::AddArtistsSearchRequest(const int offset) {
|
||||
|
||||
void TidalRequest::AlbumsSearch() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Searching..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Searching..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddAlbumsSearchRequest();
|
||||
|
||||
}
|
||||
@@ -398,8 +398,8 @@ void TidalRequest::AddAlbumsSearchRequest(const int offset) {
|
||||
|
||||
void TidalRequest::SongsSearch() {
|
||||
|
||||
emit UpdateStatus(query_id_, tr("Searching..."));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
Q_EMIT UpdateStatus(query_id_, tr("Searching..."));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
AddSongsSearchRequest();
|
||||
|
||||
}
|
||||
@@ -463,7 +463,7 @@ void TidalRequest::ArtistsReplyReceived(QNetworkReply *reply, const int limit_re
|
||||
}
|
||||
|
||||
if (offset_requested == 0) {
|
||||
emit UpdateProgress(query_id_, GetProgress(artists_received_, artists_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(artists_received_, artists_total_));
|
||||
}
|
||||
|
||||
QJsonValue value_items = ExtractItems(json_obj);
|
||||
@@ -521,7 +521,7 @@ void TidalRequest::ArtistsReplyReceived(QNetworkReply *reply, const int limit_re
|
||||
}
|
||||
artists_received_ += artists_received;
|
||||
|
||||
if (offset_requested != 0) emit UpdateProgress(query_id_, GetProgress(artists_received_, artists_total_));
|
||||
if (offset_requested != 0) Q_EMIT UpdateProgress(query_id_, GetProgress(artists_received_, artists_total_));
|
||||
|
||||
ArtistsFinishCheck(limit_requested, offset, artists_received);
|
||||
|
||||
@@ -549,9 +549,9 @@ void TidalRequest::ArtistsFinishCheck(const int limit, const int offset, const i
|
||||
artist_albums_requests_pending_.clear();
|
||||
|
||||
if (artist_albums_requests_total_ > 0) {
|
||||
if (artist_albums_requests_total_ == 1) emit UpdateStatus(query_id_, tr("Receiving albums for %1 artist...").arg(artist_albums_requests_total_));
|
||||
else emit UpdateStatus(query_id_, tr("Receiving albums for %1 artists...").arg(artist_albums_requests_total_));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
if (artist_albums_requests_total_ == 1) Q_EMIT UpdateStatus(query_id_, tr("Receiving albums for %1 artist...").arg(artist_albums_requests_total_));
|
||||
else Q_EMIT UpdateStatus(query_id_, tr("Receiving albums for %1 artists...").arg(artist_albums_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -603,7 +603,7 @@ void TidalRequest::ArtistAlbumsReplyReceived(QNetworkReply *reply, const Artist
|
||||
|
||||
--artist_albums_requests_active_;
|
||||
++artist_albums_requests_received_;
|
||||
emit UpdateProgress(query_id_, GetProgress(artist_albums_requests_received_, artist_albums_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(artist_albums_requests_received_, artist_albums_requests_total_));
|
||||
AlbumsReceived(reply, artist, 0, offset_requested, false);
|
||||
|
||||
}
|
||||
@@ -770,7 +770,7 @@ void TidalRequest::AlbumsReceived(QNetworkReply *reply, const Artist &artist_req
|
||||
|
||||
if (query_type_ == Type::FavouriteAlbums || query_type_ == Type::SearchAlbums) {
|
||||
albums_received_ += albums_received;
|
||||
emit UpdateProgress(query_id_, GetProgress(albums_received_, albums_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(albums_received_, albums_total_));
|
||||
}
|
||||
|
||||
AlbumsFinishCheck(artist_requested, limit_requested, offset, albums_total, albums_received);
|
||||
@@ -819,9 +819,9 @@ void TidalRequest::AlbumsFinishCheck(const Artist &artist, const int limit, cons
|
||||
album_songs_requests_pending_.clear();
|
||||
|
||||
if (album_songs_requests_total_ > 0) {
|
||||
if (album_songs_requests_total_ == 1) emit UpdateStatus(query_id_, tr("Receiving songs for %1 album...").arg(album_songs_requests_total_));
|
||||
else emit UpdateStatus(query_id_, tr("Receiving songs for %1 albums...").arg(album_songs_requests_total_));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
if (album_songs_requests_total_ == 1) Q_EMIT UpdateStatus(query_id_, tr("Receiving songs for %1 album...").arg(album_songs_requests_total_));
|
||||
else Q_EMIT UpdateStatus(query_id_, tr("Receiving songs for %1 albums...").arg(album_songs_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -879,7 +879,7 @@ void TidalRequest::AlbumSongsReplyReceived(QNetworkReply *reply, const Artist &a
|
||||
--album_songs_requests_active_;
|
||||
++album_songs_requests_received_;
|
||||
if (offset_requested == 0) {
|
||||
emit UpdateProgress(query_id_, GetProgress(album_songs_requests_received_, album_songs_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(album_songs_requests_received_, album_songs_requests_total_));
|
||||
}
|
||||
SongsReceived(reply, artist, album, 0, offset_requested, false);
|
||||
|
||||
@@ -976,7 +976,7 @@ void TidalRequest::SongsReceived(QNetworkReply *reply, const Artist &artist, con
|
||||
|
||||
if (query_type_ == Type::FavouriteSongs || query_type_ == Type::SearchSongs) {
|
||||
songs_received_ += songs_received;
|
||||
emit UpdateProgress(query_id_, GetProgress(songs_received_, songs_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(songs_received_, songs_total_));
|
||||
}
|
||||
|
||||
SongsFinishCheck(artist, album, limit_requested, offset_requested, songs_total, songs_received);
|
||||
@@ -1196,9 +1196,9 @@ void TidalRequest::GetAlbumCovers() {
|
||||
AddAlbumCoverRequest(song);
|
||||
}
|
||||
|
||||
if (album_covers_requests_total_ == 1) emit UpdateStatus(query_id_, tr("Receiving album cover for %1 album...").arg(album_covers_requests_total_));
|
||||
else emit UpdateStatus(query_id_, tr("Receiving album covers for %1 albums...").arg(album_covers_requests_total_));
|
||||
emit UpdateProgress(query_id_, 0);
|
||||
if (album_covers_requests_total_ == 1) Q_EMIT UpdateStatus(query_id_, tr("Receiving album cover for %1 album...").arg(album_covers_requests_total_));
|
||||
else Q_EMIT UpdateStatus(query_id_, tr("Receiving album covers for %1 albums...").arg(album_covers_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, 0);
|
||||
|
||||
StartRequests();
|
||||
|
||||
@@ -1259,7 +1259,7 @@ void TidalRequest::AlbumCoverReceived(QNetworkReply *reply, const QString &album
|
||||
|
||||
if (finished_) return;
|
||||
|
||||
emit UpdateProgress(query_id_, GetProgress(album_covers_requests_received_, album_covers_requests_total_));
|
||||
Q_EMIT UpdateProgress(query_id_, GetProgress(album_covers_requests_received_, album_covers_requests_total_));
|
||||
|
||||
if (!album_covers_requests_sent_.contains(album_id)) {
|
||||
AlbumCoverFinishCheck();
|
||||
@@ -1363,18 +1363,18 @@ void TidalRequest::FinishCheck() {
|
||||
if (songs_.isEmpty()) {
|
||||
if (errors_.isEmpty()) {
|
||||
if (IsSearch()) {
|
||||
emit Results(query_id_, SongMap(), tr("No match."));
|
||||
Q_EMIT Results(query_id_, SongMap(), tr("No match."));
|
||||
}
|
||||
else {
|
||||
emit Results(query_id_);
|
||||
Q_EMIT Results(query_id_);
|
||||
}
|
||||
}
|
||||
else {
|
||||
emit Results(query_id_, SongMap(), ErrorsToHTML(errors_));
|
||||
Q_EMIT Results(query_id_, SongMap(), ErrorsToHTML(errors_));
|
||||
}
|
||||
}
|
||||
else {
|
||||
emit Results(query_id_, songs_);
|
||||
Q_EMIT Results(query_id_, songs_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ void TidalService::ExitReceived() {
|
||||
QObject::disconnect(obj, nullptr, this, nullptr);
|
||||
qLog(Debug) << obj << "successfully exited.";
|
||||
wait_for_exit_.removeAll(obj);
|
||||
if (wait_for_exit_.isEmpty()) emit ExitFinished();
|
||||
if (wait_for_exit_.isEmpty()) Q_EMIT ExitFinished();
|
||||
|
||||
}
|
||||
|
||||
@@ -339,8 +339,8 @@ void TidalService::AuthorizationUrlReceived(const QUrl &url) {
|
||||
s.remove("session_id");
|
||||
s.endGroup();
|
||||
|
||||
emit LoginComplete(true);
|
||||
emit LoginSuccess();
|
||||
Q_EMIT LoginComplete(true);
|
||||
Q_EMIT LoginSuccess();
|
||||
}
|
||||
|
||||
else if (url_query.hasQueryItem(QStringLiteral("code")) && url_query.hasQueryItem(QStringLiteral("state"))) {
|
||||
@@ -510,8 +510,8 @@ void TidalService::AccessTokenRequestFinished(QNetworkReply *reply) {
|
||||
|
||||
qLog(Debug) << "Tidal: Login successful" << "user id" << user_id_;
|
||||
|
||||
emit LoginComplete(true);
|
||||
emit LoginSuccess();
|
||||
Q_EMIT LoginComplete(true);
|
||||
Q_EMIT LoginSuccess();
|
||||
|
||||
}
|
||||
|
||||
@@ -650,8 +650,8 @@ void TidalService::HandleAuthReply(QNetworkReply *reply) {
|
||||
login_attempts_ = 0;
|
||||
timer_login_attempt_->stop();
|
||||
|
||||
emit LoginComplete(true);
|
||||
emit LoginSuccess();
|
||||
Q_EMIT LoginComplete(true);
|
||||
Q_EMIT LoginSuccess();
|
||||
|
||||
}
|
||||
|
||||
@@ -687,23 +687,23 @@ void TidalService::TryLogin() {
|
||||
if (authenticated() || login_sent_) return;
|
||||
|
||||
if (api_token_.isEmpty()) {
|
||||
emit LoginComplete(false, tr("Missing Tidal API token."));
|
||||
Q_EMIT LoginComplete(false, tr("Missing Tidal API token."));
|
||||
return;
|
||||
}
|
||||
if (username_.isEmpty()) {
|
||||
emit LoginComplete(false, tr("Missing Tidal username."));
|
||||
Q_EMIT LoginComplete(false, tr("Missing Tidal username."));
|
||||
return;
|
||||
}
|
||||
if (password_.isEmpty()) {
|
||||
emit LoginComplete(false, tr("Missing Tidal password."));
|
||||
Q_EMIT LoginComplete(false, tr("Missing Tidal password."));
|
||||
return;
|
||||
}
|
||||
if (login_attempts_ >= kLoginAttempts) {
|
||||
emit LoginComplete(false, tr("Not authenticated with Tidal and reached maximum number of login attempts."));
|
||||
Q_EMIT LoginComplete(false, tr("Not authenticated with Tidal and reached maximum number of login attempts."));
|
||||
return;
|
||||
}
|
||||
|
||||
emit RequestLogin();
|
||||
Q_EMIT RequestLogin();
|
||||
|
||||
}
|
||||
|
||||
@@ -721,12 +721,12 @@ void TidalService::GetArtists() {
|
||||
|
||||
if (!authenticated()) {
|
||||
if (oauth_) {
|
||||
emit ArtistsResults(SongMap(), tr("Not authenticated with Tidal."));
|
||||
Q_EMIT ArtistsResults(SongMap(), tr("Not authenticated with Tidal."));
|
||||
ShowConfig();
|
||||
return;
|
||||
}
|
||||
else if (api_token_.isEmpty() || username_.isEmpty() || password_.isEmpty()) {
|
||||
emit ArtistsResults(SongMap(), tr("Missing Tidal API token, username or password."));
|
||||
Q_EMIT ArtistsResults(SongMap(), tr("Missing Tidal API token, username or password."));
|
||||
ShowConfig();
|
||||
return;
|
||||
}
|
||||
@@ -747,19 +747,19 @@ void TidalService::GetArtists() {
|
||||
void TidalService::ArtistsResultsReceived(const int id, const SongMap &songs, const QString &error) {
|
||||
|
||||
Q_UNUSED(id);
|
||||
emit ArtistsResults(songs, error);
|
||||
Q_EMIT ArtistsResults(songs, error);
|
||||
ResetArtistsRequest();
|
||||
|
||||
}
|
||||
|
||||
void TidalService::ArtistsUpdateStatusReceived(const int id, const QString &text) {
|
||||
Q_UNUSED(id);
|
||||
emit ArtistsUpdateStatus(text);
|
||||
Q_EMIT ArtistsUpdateStatus(text);
|
||||
}
|
||||
|
||||
void TidalService::ArtistsUpdateProgressReceived(const int id, const int progress) {
|
||||
Q_UNUSED(id);
|
||||
emit ArtistsUpdateProgress(progress);
|
||||
Q_EMIT ArtistsUpdateProgress(progress);
|
||||
}
|
||||
|
||||
void TidalService::ResetAlbumsRequest() {
|
||||
@@ -776,12 +776,12 @@ void TidalService::GetAlbums() {
|
||||
|
||||
if (!authenticated()) {
|
||||
if (oauth_) {
|
||||
emit AlbumsResults(SongMap(), tr("Not authenticated with Tidal."));
|
||||
Q_EMIT AlbumsResults(SongMap(), tr("Not authenticated with Tidal."));
|
||||
ShowConfig();
|
||||
return;
|
||||
}
|
||||
else if (api_token_.isEmpty() || username_.isEmpty() || password_.isEmpty()) {
|
||||
emit AlbumsResults(SongMap(), tr("Missing Tidal API token, username or password."));
|
||||
Q_EMIT AlbumsResults(SongMap(), tr("Missing Tidal API token, username or password."));
|
||||
ShowConfig();
|
||||
return;
|
||||
}
|
||||
@@ -802,19 +802,19 @@ void TidalService::GetAlbums() {
|
||||
void TidalService::AlbumsResultsReceived(const int id, const SongMap &songs, const QString &error) {
|
||||
|
||||
Q_UNUSED(id);
|
||||
emit AlbumsResults(songs, error);
|
||||
Q_EMIT AlbumsResults(songs, error);
|
||||
ResetAlbumsRequest();
|
||||
|
||||
}
|
||||
|
||||
void TidalService::AlbumsUpdateStatusReceived(const int id, const QString &text) {
|
||||
Q_UNUSED(id);
|
||||
emit AlbumsUpdateStatus(text);
|
||||
Q_EMIT AlbumsUpdateStatus(text);
|
||||
}
|
||||
|
||||
void TidalService::AlbumsUpdateProgressReceived(const int id, const int progress) {
|
||||
Q_UNUSED(id);
|
||||
emit AlbumsUpdateProgress(progress);
|
||||
Q_EMIT AlbumsUpdateProgress(progress);
|
||||
}
|
||||
|
||||
void TidalService::ResetSongsRequest() {
|
||||
@@ -831,12 +831,12 @@ void TidalService::GetSongs() {
|
||||
|
||||
if (!authenticated()) {
|
||||
if (oauth_) {
|
||||
emit SongsResults(SongMap(), tr("Not authenticated with Tidal."));
|
||||
Q_EMIT SongsResults(SongMap(), tr("Not authenticated with Tidal."));
|
||||
ShowConfig();
|
||||
return;
|
||||
}
|
||||
else if (api_token_.isEmpty() || username_.isEmpty() || password_.isEmpty()) {
|
||||
emit SongsResults(SongMap(), tr("Missing Tidal API token, username or password."));
|
||||
Q_EMIT SongsResults(SongMap(), tr("Missing Tidal API token, username or password."));
|
||||
ShowConfig();
|
||||
return;
|
||||
}
|
||||
@@ -857,19 +857,19 @@ void TidalService::GetSongs() {
|
||||
void TidalService::SongsResultsReceived(const int id, const SongMap &songs, const QString &error) {
|
||||
|
||||
Q_UNUSED(id);
|
||||
emit SongsResults(songs, error);
|
||||
Q_EMIT SongsResults(songs, error);
|
||||
ResetSongsRequest();
|
||||
|
||||
}
|
||||
|
||||
void TidalService::SongsUpdateStatusReceived(const int id, const QString &text) {
|
||||
Q_UNUSED(id);
|
||||
emit SongsUpdateStatus(text);
|
||||
Q_EMIT SongsUpdateStatus(text);
|
||||
}
|
||||
|
||||
void TidalService::SongsUpdateProgressReceived(const int id, const int progress) {
|
||||
Q_UNUSED(id);
|
||||
emit SongsUpdateProgress(progress);
|
||||
Q_EMIT SongsUpdateProgress(progress);
|
||||
}
|
||||
|
||||
int TidalService::Search(const QString &text, StreamingSearchView::SearchType type) {
|
||||
@@ -894,12 +894,12 @@ void TidalService::StartSearch() {
|
||||
|
||||
if (!authenticated()) {
|
||||
if (oauth_) {
|
||||
emit SearchResults(pending_search_id_, SongMap(), tr("Not authenticated with Tidal."));
|
||||
Q_EMIT SearchResults(pending_search_id_, SongMap(), tr("Not authenticated with Tidal."));
|
||||
ShowConfig();
|
||||
return;
|
||||
}
|
||||
else if (api_token_.isEmpty() || username_.isEmpty() || password_.isEmpty()) {
|
||||
emit SearchResults(pending_search_id_, SongMap(), tr("Missing Tidal API token, username or password."));
|
||||
Q_EMIT SearchResults(pending_search_id_, SongMap(), tr("Missing Tidal API token, username or password."));
|
||||
ShowConfig();
|
||||
return;
|
||||
}
|
||||
@@ -949,7 +949,7 @@ void TidalService::SendSearch() {
|
||||
|
||||
void TidalService::SearchResultsReceived(const int id, const SongMap &songs, const QString &error) {
|
||||
|
||||
emit SearchResults(id, songs, error);
|
||||
Q_EMIT SearchResults(id, songs, error);
|
||||
search_request_.reset();
|
||||
|
||||
}
|
||||
@@ -989,7 +989,7 @@ void TidalService::HandleStreamURLFailure(const uint id, const QUrl &media_url,
|
||||
if (!stream_url_requests_.contains(id)) return;
|
||||
stream_url_requests_.remove(id);
|
||||
|
||||
emit StreamURLFailure(id, media_url, error);
|
||||
Q_EMIT StreamURLFailure(id, media_url, error);
|
||||
|
||||
}
|
||||
|
||||
@@ -998,7 +998,7 @@ void TidalService::HandleStreamURLSuccess(const uint id, const QUrl &media_url,
|
||||
if (!stream_url_requests_.contains(id)) return;
|
||||
stream_url_requests_.remove(id);
|
||||
|
||||
emit StreamURLSuccess(id, media_url, stream_url, filetype, samplerate, bit_depth, duration);
|
||||
Q_EMIT StreamURLSuccess(id, media_url, stream_url, filetype, samplerate, bit_depth, duration);
|
||||
|
||||
}
|
||||
|
||||
@@ -1013,8 +1013,8 @@ void TidalService::LoginError(const QString &error, const QVariant &debug) {
|
||||
}
|
||||
if (debug.isValid()) qLog(Debug) << debug;
|
||||
|
||||
emit LoginFailure(error_html);
|
||||
emit LoginComplete(false, error_html);
|
||||
Q_EMIT LoginFailure(error_html);
|
||||
Q_EMIT LoginComplete(false, error_html);
|
||||
|
||||
login_errors_.clear();
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ void TidalStreamURLRequest::LoginComplete(const bool success, const QString &err
|
||||
need_login_ = false;
|
||||
|
||||
if (!success) {
|
||||
emit StreamURLFailure(id_, media_url_, error);
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -80,15 +80,15 @@ void TidalStreamURLRequest::Process() {
|
||||
|
||||
if (!authenticated()) {
|
||||
if (oauth()) {
|
||||
emit StreamURLFailure(id_, media_url_, tr("Not authenticated with Tidal."));
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, tr("Not authenticated with Tidal."));
|
||||
return;
|
||||
}
|
||||
else if (api_token().isEmpty() || username().isEmpty() || password().isEmpty()) {
|
||||
emit StreamURLFailure(id_, media_url_, tr("Missing Tidal API token, username or password."));
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, tr("Missing Tidal API token, username or password."));
|
||||
return;
|
||||
}
|
||||
need_login_ = true;
|
||||
emit TryLogin();
|
||||
Q_EMIT TryLogin();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ void TidalStreamURLRequest::Cancel() {
|
||||
reply_->abort();
|
||||
}
|
||||
else {
|
||||
emit StreamURLFailure(id_, media_url_, tr("Cancelled."));
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, tr("Cancelled."));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -159,19 +159,19 @@ void TidalStreamURLRequest::StreamURLReceived() {
|
||||
need_login_ = true;
|
||||
return;
|
||||
}
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
|
||||
QJsonObject json_obj = ExtractJsonObj(data);
|
||||
if (json_obj.isEmpty()) {
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!json_obj.contains(QLatin1String("trackId"))) {
|
||||
Error(QStringLiteral("Invalid Json reply, stream missing trackId."), json_obj);
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
int track_id = json_obj[QLatin1String("trackId")].toInt();
|
||||
@@ -211,7 +211,7 @@ void TidalStreamURLRequest::StreamURLReceived() {
|
||||
|
||||
json_obj = ExtractJsonObj(data_manifest);
|
||||
if (json_obj.isEmpty()) {
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -220,14 +220,14 @@ void TidalStreamURLRequest::StreamURLReceived() {
|
||||
QString key_id = json_obj[QLatin1String("keyId")].toString();
|
||||
if (!encryption_type.isEmpty() && !key_id.isEmpty()) {
|
||||
Error(tr("Received URL with %1 encrypted stream from Tidal. Strawberry does not currently support encrypted streams.").arg(encryption_type));
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!json_obj.contains(QLatin1String("mimeType"))) {
|
||||
Error(QStringLiteral("Invalid Json reply, stream url reply manifest is missing mimeType."), json_obj);
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ void TidalStreamURLRequest::StreamURLReceived() {
|
||||
QJsonValue json_urls = json_obj[QLatin1String("urls")];
|
||||
if (!json_urls.isArray()) {
|
||||
Error(QStringLiteral("Invalid Json reply, urls is not an array."), json_urls);
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
const QJsonArray json_array_urls = json_urls.toArray();
|
||||
@@ -273,7 +273,7 @@ void TidalStreamURLRequest::StreamURLReceived() {
|
||||
QString encryption_key = json_obj[QLatin1String("encryptionKey")].toString();
|
||||
if (!encryption_key.isEmpty()) {
|
||||
Error(tr("Received URL with encrypted stream from Tidal. Strawberry does not currently support encrypted streams."));
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -283,18 +283,18 @@ void TidalStreamURLRequest::StreamURLReceived() {
|
||||
QString security_token = json_obj[QLatin1String("securityToken")].toString();
|
||||
if (!security_type.isEmpty() && !security_token.isEmpty()) {
|
||||
Error(tr("Received URL with encrypted stream from Tidal. Strawberry does not currently support encrypted streams."));
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (urls.isEmpty()) {
|
||||
Error(QStringLiteral("Missing stream urls."), json_obj);
|
||||
emit StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
Q_EMIT StreamURLFailure(id_, media_url_, errors_.constFirst());
|
||||
return;
|
||||
}
|
||||
|
||||
emit StreamURLSuccess(id_, media_url_, urls.first(), filetype);
|
||||
Q_EMIT StreamURLSuccess(id_, media_url_, urls.first(), filetype);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ void TidalUrlHandler::GetStreamURLFailure(const uint id, const QUrl &media_url,
|
||||
Request req = requests_.take(id);
|
||||
CancelTask(req.task_id);
|
||||
|
||||
emit AsyncLoadComplete(LoadResult(media_url, LoadResult::Type::Error, error));
|
||||
Q_EMIT AsyncLoadComplete(LoadResult(media_url, LoadResult::Type::Error, error));
|
||||
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ void TidalUrlHandler::GetStreamURLSuccess(const uint id, const QUrl &media_url,
|
||||
Request req = requests_.take(id);
|
||||
CancelTask(req.task_id);
|
||||
|
||||
emit AsyncLoadComplete(LoadResult(media_url, LoadResult::Type::TrackAvailable, stream_url, filetype, samplerate, bit_depth, duration));
|
||||
Q_EMIT AsyncLoadComplete(LoadResult(media_url, LoadResult::Type::TrackAvailable, stream_url, filetype, samplerate, bit_depth, duration));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user