mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 11:19:18 +01:00
Don't show the various artists node for Jamendo (there aren't any various artists albums) - making search a bit faster
This commit is contained in:
parent
bea4b39020
commit
e63c101223
@ -48,6 +48,7 @@ LibraryModel::LibraryModel(LibraryBackend* backend, QObject* parent)
|
||||
backend_(backend),
|
||||
dir_model_(new LibraryDirectoryModel(backend, this)),
|
||||
show_smart_playlists_(false),
|
||||
show_various_artists_(true),
|
||||
artist_icon_(":/icons/22x22/x-clementine-artist.png"),
|
||||
album_icon_(":/icons/22x22/x-clementine-album.png"),
|
||||
no_cover_icon_(":nocover.png"),
|
||||
@ -443,10 +444,12 @@ void LibraryModel::Reset() {
|
||||
root_ = new LibraryItem(this);
|
||||
root_->lazy_loaded = false;
|
||||
|
||||
// Various artists?
|
||||
if (group_by_[0] == GroupBy_Artist &&
|
||||
backend_->HasCompilations(query_options_))
|
||||
CreateCompilationArtistNode(false, root_);
|
||||
if (show_various_artists_) {
|
||||
// Various artists?
|
||||
if (group_by_[0] == GroupBy_Artist &&
|
||||
backend_->HasCompilations(query_options_))
|
||||
CreateCompilationArtistNode(false, root_);
|
||||
}
|
||||
|
||||
// Smart playlists?
|
||||
if (show_smart_playlists_ && query_options_.filter.isEmpty())
|
||||
|
@ -103,6 +103,7 @@ class LibraryModel : public SimpleTreeModel<LibraryItem> {
|
||||
// Call before Init()
|
||||
void set_show_smart_playlists(bool show_smart_playlists) { show_smart_playlists_ = show_smart_playlists; }
|
||||
void set_default_smart_playlists(const DefaultGenerators& defaults) { default_smart_playlists_ = defaults; }
|
||||
void set_show_various_artists(bool show_various_artists) { show_various_artists_ = show_various_artists; }
|
||||
|
||||
// Get information about the library
|
||||
void GetChildSongs(LibraryItem* item, QList<QUrl>* urls, SongList* songs,
|
||||
@ -199,6 +200,7 @@ class LibraryModel : public SimpleTreeModel<LibraryItem> {
|
||||
LibraryDirectoryModel* dir_model_;
|
||||
bool show_smart_playlists_;
|
||||
DefaultGenerators default_smart_playlists_;
|
||||
bool show_various_artists_;
|
||||
|
||||
QueryOptions query_options_;
|
||||
Grouping group_by_;
|
||||
|
@ -89,6 +89,7 @@ JamendoService::JamendoService(RadioModel* parent)
|
||||
using smart_playlists::SearchTerm;
|
||||
|
||||
library_model_ = new LibraryModel(library_backend_, this);
|
||||
library_model_->set_show_various_artists(false);
|
||||
library_model_->set_show_smart_playlists(true);
|
||||
library_model_->set_default_smart_playlists(LibraryModel::DefaultGenerators()
|
||||
<< (LibraryModel::GeneratorList()
|
||||
|
Loading…
Reference in New Issue
Block a user