Move SearchType to StreamingService

This commit is contained in:
Jonas Kvinge
2025-03-08 22:41:43 +01:00
parent f85d60f5cd
commit baa82966d8
11 changed files with 52 additions and 57 deletions

View File

@@ -111,7 +111,7 @@ SpotifyService::SpotifyService(const SharedPtr<TaskManager> task_manager,
login_time_(0),
pending_search_id_(0),
next_pending_search_id_(1),
pending_search_type_(StreamingSearchView::SearchType::Artists),
pending_search_type_(SearchType::Artists),
search_id_(0),
server_(nullptr) {
@@ -656,7 +656,7 @@ void SpotifyService::SongsUpdateProgressReceived(const int id, const int progres
Q_EMIT SongsUpdateProgress(progress);
}
int SpotifyService::Search(const QString &text, StreamingSearchView::SearchType type) {
int SpotifyService::Search(const QString &text, const SearchType type) {
pending_search_id_ = next_pending_search_id_;
pending_search_text_ = text;
@@ -697,13 +697,13 @@ void SpotifyService::SendSearch() {
SpotifyBaseRequest::Type type = SpotifyBaseRequest::Type::None;
switch (pending_search_type_) {
case StreamingSearchView::SearchType::Artists:
case SearchType::Artists:
type = SpotifyBaseRequest::Type::SearchArtists;
break;
case StreamingSearchView::SearchType::Albums:
case SearchType::Albums:
type = SpotifyBaseRequest::Type::SearchAlbums;
break;
case StreamingSearchView::SearchType::Songs:
case SearchType::Songs:
type = SpotifyBaseRequest::Type::SearchSongs;
break;
default:

View File

@@ -74,7 +74,7 @@ class SpotifyService : public StreamingService {
void Exit() override;
void ReloadSettings() override;
int Search(const QString &text, StreamingSearchView::SearchType type) override;
int Search(const QString &text, const SearchType type) override;
void CancelSearch() override;
int artistssearchlimit() const { return artistssearchlimit_; }
@@ -173,7 +173,7 @@ class SpotifyService : public StreamingService {
int pending_search_id_;
int next_pending_search_id_;
QString pending_search_text_;
StreamingSearchView::SearchType pending_search_type_;
SearchType pending_search_type_;
int search_id_;
QString search_text_;