diff --git a/src/db/Selection.cxx b/src/db/Selection.cxx index 4c8f413fc..c4d2d39ca 100644 --- a/src/db/Selection.cxx +++ b/src/db/Selection.cxx @@ -34,9 +34,9 @@ DatabaseSelection::DatabaseSelection(const char *_uri, bool _recursive, } bool -DatabaseSelection::IsEmpty() const noexcept +DatabaseSelection::IsFiltered() const noexcept { - return uri.empty() && (filter == nullptr || filter->IsEmpty()); + return !uri.empty() || (filter != nullptr && !filter->IsEmpty()); } bool diff --git a/src/db/Selection.hxx b/src/db/Selection.hxx index a54210dac..6ddf616f3 100644 --- a/src/db/Selection.hxx +++ b/src/db/Selection.hxx @@ -60,7 +60,7 @@ struct DatabaseSelection { const SongFilter *_filter=nullptr) noexcept; [[gnu::pure]] - bool IsEmpty() const noexcept; + bool IsFiltered() const noexcept; /** * Does this selection contain constraints other than "base"? diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx index a832a7025..981fe362e 100644 --- a/src/db/plugins/ProxyDatabasePlugin.cxx +++ b/src/db/plugins/ProxyDatabasePlugin.cxx @@ -992,7 +992,7 @@ ProxyDatabase::Visit(const DatabaseSelection &selection, visit_song); if (!visit_directory && !visit_playlist && selection.recursive && - !selection.IsEmpty()) { + selection.IsFiltered()) { /* this optimized code path can only be used under certain conditions */ ::SearchSongs(connection, selection, visit_song);