diff --git a/src/internet/internetsearchmodel.cpp b/src/internet/internetsearchmodel.cpp index 2905fb376..f117f7f89 100644 --- a/src/internet/internetsearchmodel.cpp +++ b/src/internet/internetsearchmodel.cpp @@ -393,11 +393,11 @@ MimeData *InternetSearchModel::LoadTracks(const InternetSearchView::ResultList & return nullptr; } - SongMap songs; + SongList songs; QList urls; urls.reserve(results.count()); for (const InternetSearchView::Result &result : results) { - songs.insert(result.metadata_.song_id(), result.metadata_); + songs.append(result.metadata_); urls << result.metadata_.url(); } diff --git a/src/internet/internetsearchview.cpp b/src/internet/internetsearchview.cpp index 582f03e96..815de7ba9 100644 --- a/src/internet/internetsearchview.cpp +++ b/src/internet/internetsearchview.cpp @@ -766,7 +766,7 @@ void InternetSearchView::AddArtists() { MimeData *mimedata = SelectedMimeData(); if (!mimedata) return; if (const InternetSongMimeData *internet_song_data = qobject_cast(mimedata)) { - emit AddArtistsSignal(internet_song_data->songs.values()); + emit AddArtistsSignal(internet_song_data->songs); } } @@ -776,7 +776,7 @@ void InternetSearchView::AddAlbums() { MimeData *mimedata = SelectedMimeData(); if (!mimedata) return; if (const InternetSongMimeData *internet_song_data = qobject_cast(mimedata)) { - emit AddAlbumsSignal(internet_song_data->songs.values()); + emit AddAlbumsSignal(internet_song_data->songs); } } diff --git a/src/internet/internetsearchview.h b/src/internet/internetsearchview.h index 477f94de8..c99d37d63 100644 --- a/src/internet/internetsearchview.h +++ b/src/internet/internetsearchview.h @@ -142,7 +142,7 @@ class InternetSearchView : public QWidget { void AddToPlaylist(QMimeData*); void AddArtistsSignal(SongList); void AddAlbumsSignal(SongList); - void AddSongsSignal(SongMap); + void AddSongsSignal(SongList); private slots: void SwapModels(); diff --git a/src/internet/internetservice.h b/src/internet/internetservice.h index 7551342ca..3003ba723 100644 --- a/src/internet/internetservice.h +++ b/src/internet/internetservice.h @@ -123,7 +123,7 @@ class InternetService : public QObject { void AddArtists(SongList songs); void AddAlbums(SongList songs); - void AddSongs(SongMap songs); + void AddSongs(SongList songs); void RemoveArtists(SongList songs); void RemoveAlbums(SongList songs); diff --git a/src/internet/internetsongmimedata.h b/src/internet/internetsongmimedata.h index e51b6e2ea..05fc2a336 100644 --- a/src/internet/internetsongmimedata.h +++ b/src/internet/internetsongmimedata.h @@ -21,8 +21,6 @@ #ifndef INTERNETSONGMIMEDATA_H #define INTERNETSONGMIMEDATA_H -#include - #include "core/mimedata.h" #include "core/song.h" @@ -35,7 +33,7 @@ class InternetSongMimeData : public MimeData { explicit InternetSongMimeData(InternetService *_service, QObject* = nullptr) : service(_service) {} InternetService *service; - SongMap songs; + SongList songs; }; #endif // INTERNETSONGMIMEDATA_H diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index 178849619..67bc9d5cd 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -796,7 +796,7 @@ bool Playlist::dropMimeData(const QMimeData *data, Qt::DropAction action, int ro InsertSmartPlaylist(generator_data->generator_, row, play_now, enqueue_now, enqueue_next_now); } else if (const InternetSongMimeData *internet_song_data = qobject_cast(data)) { - InsertInternetItems(internet_song_data->service, internet_song_data->songs.values(), row, play_now, enqueue_now, enqueue_next_now); + InsertInternetItems(internet_song_data->service, internet_song_data->songs, row, play_now, enqueue_now, enqueue_next_now); } else if (const RadioMimeData *radio_data = qobject_cast(data)) { InsertRadioItems(radio_data->songs, row, play_now, enqueue_now, enqueue_next_now); diff --git a/src/qobuz/qobuzfavoriterequest.cpp b/src/qobuz/qobuzfavoriterequest.cpp index 762833267..41f814333 100644 --- a/src/qobuz/qobuzfavoriterequest.cpp +++ b/src/qobuz/qobuzfavoriterequest.cpp @@ -93,6 +93,10 @@ void QobuzFavoriteRequest::AddAlbums(const SongList &songs) { AddFavorites(FavoriteType_Albums, songs); } +void QobuzFavoriteRequest::AddSongs(const SongList &songs) { + AddFavorites(FavoriteType_Songs, songs); +} + void QobuzFavoriteRequest::AddSongs(const SongMap &songs) { AddFavoritesRequest(FavoriteType_Songs, songs.keys(), songs.values()); } diff --git a/src/qobuz/qobuzfavoriterequest.h b/src/qobuz/qobuzfavoriterequest.h index 5d521d0d1..d99c4e742 100644 --- a/src/qobuz/qobuzfavoriterequest.h +++ b/src/qobuz/qobuzfavoriterequest.h @@ -63,6 +63,7 @@ class QobuzFavoriteRequest : public QobuzBaseRequest { public slots: void AddArtists(const SongList &songs); void AddAlbums(const SongList &songs); + void AddSongs(const SongList &songs); void AddSongs(const SongMap &songs); void RemoveArtists(const SongList &songs); void RemoveAlbums(const SongList &songs); diff --git a/src/qobuz/qobuzservice.cpp b/src/qobuz/qobuzservice.cpp index dbd1099b6..642de0a2a 100644 --- a/src/qobuz/qobuzservice.cpp +++ b/src/qobuz/qobuzservice.cpp @@ -157,7 +157,7 @@ QobuzService::QobuzService(Application *app, QObject *parent) QObject::connect(this, &QobuzService::AddArtists, favorite_request_, &QobuzFavoriteRequest::AddArtists); QObject::connect(this, &QobuzService::AddAlbums, favorite_request_, &QobuzFavoriteRequest::AddAlbums); - QObject::connect(this, &QobuzService::AddSongs, favorite_request_, &QobuzFavoriteRequest::AddSongs); + QObject::connect(this, &QobuzService::AddSongs, favorite_request_, QOverload::of(&QobuzFavoriteRequest::AddSongs)); QObject::connect(this, &QobuzService::RemoveArtists, favorite_request_, &QobuzFavoriteRequest::RemoveArtists); QObject::connect(this, &QobuzService::RemoveAlbums, favorite_request_, &QobuzFavoriteRequest::RemoveAlbums); diff --git a/src/tidal/tidalfavoriterequest.cpp b/src/tidal/tidalfavoriterequest.cpp index 24d2f0b7a..380fa0cdc 100644 --- a/src/tidal/tidalfavoriterequest.cpp +++ b/src/tidal/tidalfavoriterequest.cpp @@ -96,6 +96,10 @@ void TidalFavoriteRequest::AddAlbums(const SongList &songs) { AddFavorites(FavoriteType_Albums, songs); } +void TidalFavoriteRequest::AddSongs(const SongList &songs) { + AddFavorites(FavoriteType_Songs, songs); +} + void TidalFavoriteRequest::AddSongs(const SongMap &songs) { AddFavoritesRequest(FavoriteType_Songs, songs.keys(), songs.values()); } diff --git a/src/tidal/tidalfavoriterequest.h b/src/tidal/tidalfavoriterequest.h index 636a91b5e..e337c1c4f 100644 --- a/src/tidal/tidalfavoriterequest.h +++ b/src/tidal/tidalfavoriterequest.h @@ -66,6 +66,7 @@ class TidalFavoriteRequest : public TidalBaseRequest { public slots: void AddArtists(const SongList &songs); void AddAlbums(const SongList &songs); + void AddSongs(const SongList &songs); void AddSongs(const SongMap &songs); void RemoveArtists(const SongList &songs); diff --git a/src/tidal/tidalservice.cpp b/src/tidal/tidalservice.cpp index a663882d7..95fbc26af 100644 --- a/src/tidal/tidalservice.cpp +++ b/src/tidal/tidalservice.cpp @@ -177,7 +177,7 @@ TidalService::TidalService(Application *app, QObject *parent) QObject::connect(this, &TidalService::AddArtists, favorite_request_, &TidalFavoriteRequest::AddArtists); QObject::connect(this, &TidalService::AddAlbums, favorite_request_, &TidalFavoriteRequest::AddAlbums); - QObject::connect(this, &TidalService::AddSongs, favorite_request_, &TidalFavoriteRequest::AddSongs); + QObject::connect(this, &TidalService::AddSongs, favorite_request_, QOverload::of(&TidalFavoriteRequest::AddSongs)); QObject::connect(this, &TidalService::RemoveArtists, favorite_request_, &TidalFavoriteRequest::RemoveArtists); QObject::connect(this, &TidalService::RemoveAlbums, favorite_request_, &TidalFavoriteRequest::RemoveAlbums);