mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-24 16:31:22 +01:00
Smarter adding/removing from various artists. Fixes issue #717
This commit is contained in:
parent
01cccc0468
commit
5e17e93360
@ -215,8 +215,8 @@ void LibraryView::contextMenuEvent(QContextMenuEvent *e) {
|
||||
->mapToSource(context_menu_index_);
|
||||
|
||||
const int type = library_->data(context_menu_index_, LibraryModel::Role_Type).toInt();
|
||||
const int container_type = library_->data(context_menu_index_, LibraryModel::Role_ContainerType).toInt();
|
||||
const bool enable_various = container_type == LibraryModel::GroupBy_Album;
|
||||
const bool enable_various = type == LibraryItem::Type_Container ||
|
||||
type == LibraryItem::Type_Song;
|
||||
const bool smart_playlist = type == LibraryItem::Type_SmartPlaylist;
|
||||
const bool show_smart = type == LibraryItem::Type_PlaylistContainer ||
|
||||
smart_playlist;
|
||||
@ -257,9 +257,17 @@ void LibraryView::ShowInVarious(bool on) {
|
||||
if (!context_menu_index_.isValid())
|
||||
return;
|
||||
|
||||
QString artist = library_->data(context_menu_index_, LibraryModel::Role_Artist).toString();
|
||||
QString album = library_->data(context_menu_index_, LibraryModel::Role_Key).toString();
|
||||
library_->backend()->ForceCompilation(artist, album, on);
|
||||
// Build a list of the selected unique album/artist combos
|
||||
typedef QPair<QString, QString> AlbumArtist;
|
||||
QSet<AlbumArtist> selected;
|
||||
foreach (const Song& song, GetSelectedSongs()) {
|
||||
selected << AlbumArtist(song.album(), song.artist());
|
||||
}
|
||||
|
||||
foreach (const AlbumArtist& albumartist, selected.values()) {
|
||||
library_->backend()->ForceCompilation(
|
||||
albumartist.second, albumartist.first, on);
|
||||
}
|
||||
}
|
||||
|
||||
void LibraryView::Load() {
|
||||
|
Loading…
Reference in New Issue
Block a user