aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-07 23:22:37 +0200
committerMax Kellermann <max@duempel.org>2012-08-08 00:55:02 +0200
commit733d6a6b16686c852b6d0fc0e4e9197add501a2f (patch)
treec089ab2961a5b98558f7587df3c5ef995628e8b3 /src/db
parent8d2725234e6271434d87ecaac23ef882850e649a (diff)
DatabaseSelection: add "match" attribute
Let the database plugin do the match.
Diffstat (limited to 'src/db')
-rw-r--r--src/db/SimpleDatabasePlugin.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/db/SimpleDatabasePlugin.cxx b/src/db/SimpleDatabasePlugin.cxx
index e1cf0167..08a285d3 100644
--- a/src/db/SimpleDatabasePlugin.cxx
+++ b/src/db/SimpleDatabasePlugin.cxx
@@ -27,6 +27,7 @@ extern "C" {
#include "db_save.h"
#include "db_lock.h"
#include "conf.h"
+#include "locate.h"
}
#include "directory.h"
@@ -247,7 +248,9 @@ SimpleDatabase::Visit(const DatabaseSelection &selection,
if (directory == NULL) {
struct song *song;
if (visit_song &&
- (song = GetSong(selection.uri, NULL)) != NULL)
+ (song = GetSong(selection.uri, NULL)) != NULL &&
+ (selection.match == NULL ||
+ locate_list_song_match(song, selection.match)))
return visit_song(*song, error_r);
g_set_error(error_r, db_quark(), DB_NOT_FOUND,
@@ -260,7 +263,7 @@ SimpleDatabase::Visit(const DatabaseSelection &selection,
return false;
db_lock();
- bool ret = directory->Walk(selection.recursive,
+ bool ret = directory->Walk(selection.recursive, selection.match,
visit_directory, visit_song, visit_playlist,
error_r);
db_unlock();