diff options
Diffstat (limited to 'src/dbUtils.c')
-rw-r--r-- | src/dbUtils.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/dbUtils.c b/src/dbUtils.c index 67eb89ebe..88122649e 100644 --- a/src/dbUtils.c +++ b/src/dbUtils.c @@ -200,6 +200,28 @@ int addAllInToStoredPlaylist(const char *name, const char *utf8file) } static int +findAddInDirectory(struct song *song, void *_data) +{ + struct search_data *data = _data; + + if (locate_song_match(song, data->criteria)) + return directoryAddSongToPlaylist(song, data); + + return 0; +} + +int findAddIn(struct client *client, const char *name, + const struct locate_item_list *criteria) +{ + struct search_data data; + + data.client = client; + data.criteria = criteria; + + return db_walk(name, findAddInDirectory, NULL, &data); +} + +static int directoryPrintSongInfo(struct song *song, void *data) { struct client *client = data; |